Suppose you have this other set of settings in /tmp/myvimrc
. If my reading of man vim
is correct you can start vim with this set of settings using the following:
$ vim -u /tmp/myvimrc
Thus, to make this an option for the rest of the session, I would create a function that sets this as an alias for vim
. Thus, in bash
I would put something like this in my .bashrc
file:
function vimswitch {
alias vim='vim -u /tmp/myvimrc'
}
Then, when I wanted my new vim settings, I would just run:
$ vimswitch
Note that I wouldn't store myvimrc in /tmp
since this could easily be cleared out upon reboot. If you are using a shell other than bash
this should still be possible, but the syntax could differ slightly.