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.

I recently installed vim on Windows 7 as a stand-alone binary.

Where should I put my .vimrc file?

share|improve this question
    
But is it not true that on Windows it is a _vimrc file? –  Kazark Nov 29 '11 at 16:34
2  
Windows gvim (either Cygwin or Native) will opt for _gvimrc, .gvimrc, _vimrc and finally _vimrc in that order of priority. It unders the underscore and dot format for the vimrc. –  Darren Hall Jan 17 '12 at 22:04

2 Answers 2

up vote 102 down vote accepted

From the Vim Wiki.

In Vim, your home directory is specified with $HOME. On Unix systems, this is your ~ directory. On Windows systems, the best way to find the value of $HOME is from within Vim, as follows. These commands are useful to see what directories your Vim is using:

:version
:echo expand('~')
:echo $HOME
:echo $VIM
:echo $VIMRUNTIME

Once you determine the HOME variable put the vimrc file within that directory.

If you would like to change your HOME variable, set HOME as an environment variable for either the system or user.

Computer > Properties > Advanced System Settings > Advanced > Environment Variables > User | System Variables.

Windows (both Native and Cygwin*) will use _gvimrc, .gvimrc, _vimrc and .vimrc in that order of priority. The gvim* files will be checked with the gvim process, while the console vim will only check the vim* files.

*: verified against vim 7.2 and 7.3

share|improve this answer
    
Thanks @Darren Hall. –  AJ. Dec 22 '09 at 0:43

If you need to find out just from a .bat file first look in the %HOME% directory. If that is not defined then vim/gvim looks in the path defined by concatenating %HOMEDRIVE% and %HOMEPATH%.

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.