Usually, you place your _vimrc
, _gvimrc
and the directory with your custom files (vimfiles
) within your $HOME
directory.
Vim searches there by default.
Files located there won't be overridden when updating your Vim installation, so it's generally a good idea to do this and you won't have to mess around with any variables. If you have any custom plugins, syntax files etc, place them below vimfiles/plugins
, vimfiles/syntax
etc.
Furthermore, you could ask Vim where it searches for vimrc
's using :version
:
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
system menu file: "$VIMRUNTIME\menu.vim"
as described here: How to locate the vimrc file used by vim editor?