tpope/vim-eunuch

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

gmtek opened this issue · 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

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

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.

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.