Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Windows, no matter what I set as the current directory, gVim will always set its initial working directory to $home. (That is, if I launch gVim with the current directory at C:\something, or if I set its starting directory to something on my desktop shortcut, vim will not honor this working directory.)

This gets quite annoying when I try to open up a file from the command line by entering something like gvim file.txt, since it will always assume it's a new file to be created in the $home directory.

Is this something wrong with my vim configuration, or is this default behavior? If it's the default behavior, is there a way to change it?

share|improve this question
I just do gvim .\file.txt if I want to work on a file in the local dir. – EBGreen Jul 26 '12 at 19:17
The weird thing about my computer though is that it will only open C:\Users\Username\file.txt if I type that in. – digitxp Jul 26 '12 at 19:18
Oh, I may have misunderstood. You are doing this from within gvim? Or at a command prompt? – EBGreen Jul 26 '12 at 19:20
Command prompt. – digitxp Jul 26 '12 at 19:21
That's really odd then. What I posted works fine for me. – EBGreen Jul 26 '12 at 19:26

Check the settings of your GVim, like:

Edit -> Global Settings -> Search path

Make sure that you have dot as the first argument. I've:


but it depends of your system (you're on Windows, you should have different paths, but you should have this dot at least).

You can also try to run from the command line, so the current working directory should be passed into your gvim.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .