vim-eunuch icon indicating copy to clipboard operation
vim-eunuch copied to clipboard

Rename takes path relative to shell directory instead of current file directory

Open gmtek opened this issue 1 year ago • 3 comments

Run

mkdir -p foo/bar/test && touch foo/bar/test/index.md
cd foo/bar
nvim test/index.md
:Rename ../index2.md

expected: file renamed to foo/bar/index2.md. As the doc says relative path to current file actual: file renamed to foo/index2.md. path is relative to current shell directory

gmtek avatar Feb 27 '24 09:02 gmtek

Yeah, I have beed bitten by that. I think that it worked properly in the past.

hauleth avatar Apr 15 '24 08:04 hauleth

The current behavior is intended. It mirrors commands like :find, which drops it's special 'path' based behavior and reverts to the current working directory for ./ and ../ paths. I'm disinclined to change it, but will think on it a bit before closing.

tpope avatar Jul 07 '24 19:07 tpope

Though currently we can use :Move to work with relatively to CWD, so I think that :Rename always work as a relative move and :Move always work as an "absolute" move is the most logical thing.

hauleth avatar Jul 08 '24 14:07 hauleth