Change the current vim directory from the command line

Vim (actually, gvim is in doubt, but I believe that it works both ways) at startup it has its current directory in its runtime directory.

I would like to start its cd in let say, c: \ pro
I know I can just do: cd c: \ pro, but is there any way to change it at startup using something like gvim c: \ pro ( only this does not work: - |?

+5
source share
3 answers

you can use

gvim -c "cd C:/pro"

-c allows you to run commands immediately after Vim boots.

The Vim working directory is initially installed in the working directory of the process that calls Vim.

.exe , .

"", Start in, . Start in .

run, vim, , Documents and Settings directcory.

+6

cd path .vimrc?

+1

If you use VIM mainly to work on one project at a time, you can simply put it on your own vimrcso that it is installed at startup:

Open vimrc:

:e $MYVIMRC

Then add this line:

cd c:\my\project\path
0
source

All Articles