Command line option
You can give the -u
parameter to your command line. This parameter will force the vim to read the specific vimrc without reading the system wide configurations:
/my/vim -u /path/another_vimrc
You can even create a command alias, with which you can start this custom vim. Put this in your .bash_profile
for e.g.:
alias customvim /my/vim -u /path/another_vimrc
And then start this custom vim with:
customvim
Building configuration
You can specify the prefix
option to the configuration script of when you're building from source. If you set this, vim will look for configuration file in the prefixed directory.
For e.g. if you do with stow:
./configure --prefix=/usr/local/stow/vim-7.3/ && make install
Then the vim will be installed in /usr/local/stow/vim-7.3/
and the custom configuration should be in /usr/local/stow/vim-7.3/etc/vimrc
.vimrc
file in this hack. A simpleperl -pi -e 's/\.vimrc/.vhack/g' /my/vim
should work fine. – mouviciel Mar 21 '12 at 9:52