Sometimes you just want to have vim configurations per project basis. Imagine how awesome it is to fire up vim with a different color scheme for each one of your projects. You might want to include special plugins for the Node.js project you are hacking on lately. Fortunately, this is extremely easy to accomplish.
Create a file called “vimrc-local.vim” in the
~/.vim/plugin/ directory. After that, put the following
5 lines of code in it:
1 2 3 4 5
Now you can put local vimrc file in any directory of your computer and vim will automatically
load it for you. Don’t forget that you have to name the config file “.vimrc.local”. If you prefer
a different name, you can replace
.vimrc.local with your desired name in the script we just wrote.
1 2 3
You might be curious what the local vimrc of Vim Ninjas looks like. Here it is:
1 2 3 4 5 6 7 8
Your editor might look and feel completely different depending on your current focus. Just a few lines of code and you are there. How cool is that?