Search code examples
windowsvimworking-directory

Vim: Change start up directory?


When I start GVim and start writing my little program I'd like to save the file to the Desktop but it seems that Vim is starting the command line in:

C:\Windows\System32

How would I go about changing that to:

C:\Users\Casey

so then I could just:

:w Desktop\my_program.py

Solution

  • 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.