Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

Check the settings of your GVim, like:

Edit -> Global Settings -> Search path

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

.,/usr/include,,

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.