I discovered a great feature in Vim today. While we generally
use the same Vim settings everywhere, we sometimes (have to) contribute to
projects with a coding style different of ours, and because nobody wants to
.vimrc everytime to switch between configurations, Vim allows you
to have per project
This feature can be enabled with one line in your
When you start Vim, it begins by looking at some predefined locations for a
configuration file (the first one is
disabled by default, tell to Vim to not only load your personal
also to look in the current directory to check if there’s another
which will be loaded after your personal one. You can then use it to override
your settings and/or add specific ones for this directory.
Additionally, if you share the local
.vimrc with others (e.g. in a Git
repository), you may want to set the
secure option at the end of your personal
This disallow shell and write commands in the
.vimrc of the local directory.
On unix-like OSes, this option is set by default if
you’re not the owner of the file.
For more Vim gems, check my
.vimrc on GitHub!