At work I have gvim installed in C:/Program Files/vim
but have no write permission on this folder. I would like vim to use my personal _vimrc
and potentially some addins that would be in a bundle
directory.
Problem is that vim choose the default _vimrc
in C:/...
What can I do to fix my problem, I was thinking of a script but I can't manage in writing one that work... ?
EDIT: Off course I do not have admin rights
Your configuration belongs in %HOME%
(or %USERPROFILE%
if the former isn't set). You can always override that by setting the %MYVIMRC%
environment variable (e.g. in the Windows Control Panel under Advanced System Settings) passing a different configuration script via -u path/to/vimrc
. (Defining %VIMINIT%
should work, too, but I didn't get it to work on Windows.) See :help startup
for details.
The first place Vim looks for initializations (see :h .vimrc
) is in your home directory. (If you're not sure where this is, you can use echo %HOMEPATH%
from the command prompt to find out.)
Vim will use the _vimrc
in your home directory if it exists, so you could just copy it there (%userprofile%_vimrc), or you could set the environment variable $VIM to the directory of your choice. You can set an environment variable on Windows by right-clicking on My Computer -> Properties -> Advanced System Settings. For more info see the vim docs.