nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

Allow `api.fs...` to take a path as input

Open ymn64 opened this issue 3 years ago • 1 comments

Instead of having to prompt the user to enter a filename after invoking api.fs.create, it would be nice if we could do something like this:

require('nvim-tree.api').fs.create('/path/to/file')

(If no input is passed, then prompt to enter filename.)

And the same for api.fs.paste.

A really good use case for this would be a user-friendly action for file duplication, which is a pretty common action.

ymn64 avatar Sep 26 '22 10:09 ymn64

(If no input is passed, then prompt to enter filename.)

Maintains existing behaviour.

require('nvim-tree.api').fs.create('/path/to/file')

This can apply directly to: - create - remove - trash - rename - cut - paste

In the event of a file missing/lacking permissions etc. existing behaviour can be kept: appropriate error message.

alex-courtis avatar Sep 26 '22 22:09 alex-courtis