Skip to content

Custom command for creating Directory? #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandangel opened this issue Mar 23, 2022 · 2 comments
Closed

Custom command for creating Directory? #192

sandangel opened this issue Mar 23, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@sandangel
Copy link

sandangel commented Mar 23, 2022

Hi, I would like to use a separated command/keymap to create folder. Like mapping A to create folder only, no need backslash at the end. This feels more natural to me. When I think about creating a folder, I hit keymap, then think about the name of the folder.

The current way of doing it doesn't feel good to me, when I think of creating a folder, I hit a keymap, think of a name, then realize this is a folder name so it should have /

Is there a way for adding that custom command and leverage existing neo-tree code? Thanks for an excellent plugin

@cseickel
Copy link
Contributor

Yes, but there is really a lot going on there so it's a little complicated for a function defined in a config table. The code for the existing command stats here:

The way to change this is to add an argument to specify that a directory is being created at that point, which will be passed down through to:

M.create_node = function(in_directory, callback)

So you would have to copy all of that, collapse it to one function, and make it directory only.

I can also add in that in to the built-in commands. That might take me a week or so to get to.

@cseickel cseickel added the enhancement New feature or request label Mar 23, 2022
@sandangel
Copy link
Author

Thank you very much. I love that we can have it as a builtin command. Fantastic!!! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants