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

feature request: add a 'show absolute path' toggle (and allow edits)

Open Danielkonge opened this issue 1 year ago • 5 comments

Did you check existing requests?

  • [X] I have searched the existing issues

Describe the feature

This feature request might have some overlap with #117, but I think the idea is a bit different and possibly(?) easier to implement (+ it feels more intuitive to me).

I would like to add a a command that allows you to toggle between the current file/directory names for paths in oil and the full absolute paths (+ maybe also a path relative to cwd if inside it).

When showing absolute paths I would then like to be able to edit the paths as usual (in absolute form) and get the "expected" behavior (see below).

Provide background

I would like to be able to have something like the following setup.

Say I have directories /some/path/dir1 /some/path/dir2 with a file filename inside dir1. In oil that would currently have the name filename when I am inside dir1, and I would like to be able to show its absolute path: /some/path/dir1/filename And if I then make an edit, say change it to /some/path/dir2/filename, I would like to be able to save and have the file move from dir1 to dir2.

I hope that this would not be too difficult to implement, since it would be a change in the absolute path, which should hopefully translate to a straightforward move command.

What is the significance of this feature?

strongly desired

Additional details

If you have any idea of where to start with an implementation of my suggestion, then I can spend some time on it and try to make a pull request.

Danielkonge avatar Jan 22 '24 22:01 Danielkonge

This would be difficult for the same reasons as #117. Right now there is exactly one way to move files to another location, and there is exactly one way to represent a file in a location. Once you introduce something like this, there are now multiple ways to move a file and there are multiple ways to represent a file at a location. It's not insurmountable, but it would be quite tricky to account for all the possible edge cases.

stevearc avatar Jan 23 '24 05:01 stevearc

If I would like to try to implement this, would you be fine with having a seperation between the two ways of moving files and representing files through a check for whether the path has a root or not? E.g. in a Unix system, assume that anything starting with / is an absolute path and anything else is of the form currently used in oil. (I think roots are a bit weirder in Windows, but they still exist.)

Or would that break something in oil?

Edit: Actually, making a absolute-path-mode might be easier. Then oil could have a clear distinction between standard-mode and absolute-path-mode, and it would always be clear which representation and move commands to use depending on the mode.

Danielkonge avatar Jan 23 '24 08:01 Danielkonge

Just bumping to say I would really like this feature also!

agus-videla avatar Feb 08 '24 16:02 agus-videla

I am searching for a similar feature that allows me to display the parent folder at the top, similar to how neo-tree does it.

simanga-dev avatar Apr 09 '24 22:04 simanga-dev

I am searching for a similar feature that allows me to display the parent folder at the top, similar to how neo-tree does it.

I'm also looking for that feature, maybe make it look like EMACS dired

johnpgr avatar Oct 09 '24 19:10 johnpgr