Any way to provide a separate vimrc file just for 1 session

vimvimrc

I would like to know, if there is a way in vim/vi to provide a different vimrc file. I am looking at managing 2 different vimrc files. For the contents I checkout/checkin in version control I want to use different set of commands and not the normal one in my .vimrc file

For Example.

My .vimrc file contains a command to automatically delete any trailing space while saving a file. But, I don't want this feature to be activated for specific files.

So any way to provide a different vimrc file ( maybe at command line, giving it as parameter each time as vim –vimrc=somefile file-to-open) ?

Best Answer

See the manpage:

-u {vimrc} Use the commands in the file {vimrc} for initializations. All the other initializations are skipped. Use this to edit a special kind of files. It can also be used to skip all initializations by giving the name "NONE". See ":help initialization" within vim for more details.