oil.nvim icon indicating copy to clipboard operation
oil.nvim copied to clipboard

feature request: pasting path of files into an oil buffer

Open sassanh opened this issue 1 year ago • 3 comments

Did you check existing requests?

  • [X] I have searched the existing issues

Describe the feature

It would be nice if oil.nvim could handle absolute file paths pasted into its buffers. In macOS when you copy a file in Finder, you can paste it in terminal and it will input its absolute path, if oil.nvim can copy the files upon writing the buffer, it will be possible to copy from Finder into oil.nvim.

Provide background

No response

Additional details

No response

sassanh avatar Aug 19 '23 22:08 sassanh

To clarify: if you put an absolute path in an oil buffer and save, you want it to copy the file from the absolute path into the current buffer?

stevearc avatar Aug 20 '23 04:08 stevearc

To clarify: if you put an absolute path in an oil buffer and save, you want it to copy the file from the absolute path into the current buffer?

Yes

sassanh avatar Aug 20 '23 16:08 sassanh

For relative paths, I think it may increase the potential for errors. Users may be confused if they are addressing a relative path from current directory of oil.nvim, the cwd of Noevim or the directory of the last opened file, etc.

So we can give up on relative paths altogether or we can consider resolving them to absolute paths upon pasting so that users can see and confirm the resolved path before writing the buffer.

sassanh avatar Aug 20 '23 16:08 sassanh