-
-
Notifications
You must be signed in to change notification settings - Fork 624
api.fs.create_directory #285
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
Comments
type |
Hi, great plugin but I think this is a bit unintuitive for new people (like me). I have been trying to match Vim's default file explorer's keymappings and would really like to dedicate |
We can do this. Something like: fs.create_directory({node}) *nvim-tree-api.fs.create_directory()*
Prompt to create a directory.
Parameters: ~
• {node} (Node) parent, uses the parent of a file. |
On Unix systems directory is just a type of node, same as file. Should we make it more generic, like create_node? |
Yes. We could be more generic and extend the existing create like: fs.create({node}, {opts}) *nvim-tree-api.fs.create()*
Prompt to create a file or directory. Use a trailing `/` for a directory.
Parameters: ~
• {node} (Node) parent, uses the parent of a file.
• {opts} (table) optional parameters
Options: ~
• {type} (string) `"file"` or `"directory"`, default `"file"` Only problem is how we would pass those opts in, with the node populated. Passing |
If I were designing the API from scratch today, I'd make the e.g. fs.create({opts}) *nvim-tree-api.fs.create()*
Prompt to create a file or directory. Use a trailing `/` for a directory.
Parameters: ~
• {opts} (table) optional parameters
Options: ~
• {node} (Node) default node under cursor
• {type} (string) `"file"` or `"directory"`, default `"file"` The problem is backwards compatibility. It was achieved for functions like One option is to look for fields like |
Created #2146 |
We have a functional workflow for adding directories via the trailing I'm not seeing much value here... @gegoune ? |
Personally I am not that bothered either. This is an old issue that Kiyan closed promptly. Also premise that "That would at least save people from having to google." isn't entirely true if documentation is provided with plugin itself (it is). |
Added FAQ: https://github.com/nvim-tree/nvim-tree.lua/wiki/FAQ Clarified: #2572 |
Right now
Could be nice if
The text was updated successfully, but these errors were encountered: