Vim: Change start up directory?
Assuming you're starting gvim from an icon/shortcut in Windows (from the kind of paths you supply), you can change the starting directory (completely independent from the fact that it IS gvim: it would be the same from any other app!) by editing the "starting directory" property of that Windows icon/shortcut.
Within vim, you can change the current directory with the :cd
command:
:cd c:\users\casey
I found this way to be better:
- Open gVim
:cd $vim
:e _gvimrc
Add the following line:
:cd c:\users\user\desktop\
I found that :Ex
is slow on large directories like c:\windows\system32\ (where gVim usually starts).
Also, here is my full _gvimrc in case anyone is interested. I prefer Consolas for coding. The tabstop setting helps when coding especially in Python, and Ctrl+Tab/Ctrl+Shift+Tab is great for switching between buffers:
set guifont=Consolas:h12:cANSIset tabstop=4 softtabstop=4 shiftwidth=4 expandtabmap <C-Tab> :bnext<cr>map <C-S-Tab> :bprevious<cr>:cd c:\users\user\desktop\