0

I'm running Windows 7 with gvim 7.4 installed in the default location. I have created a file C:\Users\MyUserNameHere\_vimrc with just a few lines as simple as:

set nowrap
set tabstop=2
set shiftwidth=2
set expandtab
set foldmethod=indent

There seems to be nothing wrong with my _vimrc. However, when I open a PHP file, the syntax higlighting is gone after I create this file. Of course I could just add the line

syntax on

to the _vimrc file in the directory corresponding to my username. But the fact that syntax highlighting is gone makes me think that some other useful default settings may be gone as well.

So, what I would like to know is, by creating C:\Users\MyUserNameHere\_vimrc, have I overridden another _vimrc file somewhere on the filesystem? I have tried searching from the windows search box next to the start button but found nothing.

1
  • Syntax highlighting is not enabled by default, you need to enable it yourself, as well as filetype detection, in your vimrc: filetype plugin indent on and syntax on.
    – romainl
    Aug 23, 2015 at 11:17

1 Answer 1

1

Hit :version inside Vim, you'll see the paths where Vim will search for a vimrc file.

If you run :echo $VIM, :echo $VIMRUNTIME and perhaps :echo $HOME, you'll see the actual path components.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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