Search code examples
vimterminalgnome-terminal

VIM is not working as expected with relative path address of a file


Let's say I am in my directory ~/bin and I want to open a file which is in ~/mySetting/commands.txt.
So, from the terminal when I enter vim ../mySetting/commands.txt, vim opens it as a new directory. But when I enter the full path like vim ~/mySetting/commands.txt, It opens it as expected. Does VIM not work with relative path?? Or


Solution

  • It's possible if ~/bin is a symlink to somewhere deeper in the hierarchy. For example, if ~/bin is a symlink to ~/.local/share/bin then ../mySetting/commands.txt would be ~/.local/share/mySetting/commands.txt.

    To test: ls -l ~/bin and cd ~/bin && pwd -P && ls -l ../mySetting/commands.txt