Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install multiple version of Vim, and make each use different .vimrc file, respectively

Tags:

linux

vim

ubuntu

Make it on Linux. The reason to use more than one version of Vim, is because one version would be heavily hacked, for Lisp jobs. I want separate it and make it use it's own .vimrc file as well.

/usr/bin/vim   use -> ~/.vimrc
/my/vim        use -> ..../another_vimrc
like image 619
Andrew_1510 Avatar asked Mar 21 '12 08:03

Andrew_1510


1 Answers

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

like image 152
KARASZI István Avatar answered Oct 10 '22 11:10

KARASZI István