MacVim: Files outside of the home directory cannot be opened from the command line unless full path is specified

StackOverflow https://stackoverflow.com/questions/4702364

  •  11-10-2019
  •  | 
  •  

Question

I'm trying to open a file using MacVim 7.3 (53) from the command line using the bash shell in the Terminal system application in OS X 10.6.6. Files specified as command line arguments to MacVim are always opened from the home folder. For example:

> cd ~
> cd somefolder
> MacVim somefile.txt 

This results in the file ~/somefile.txt being opened instead of ~/somefolder/somefile.txt.

If the full path to the file is specified in the command line argument the file will be opened as expected. For example:

> cd ~
> MacVim ~/somefolder/somefile.txt

Setting the option autochdir in .vimrc does not resolve the issue.

Was it helpful?

Solution

Use the mvim command line shell script to execute MacVim from command line. Just tested and it works as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top