I normally use 4 spaces for indentation. However I occasionally submit patches to OSS projects and some of them use tabs. When I do that I'll usually just edit my ~/.vimrc
and change set expandtab
to set noexpandtab
. Of course then I'll forget to unset it, which is only a very minor annoyance.
I've also recently been toying with setting the VIMINIT
variable if I open a shell to work on that project. I would just need to re-set it if I close that shell. Not the worst thing in the world but ...
I'm wondering if there is a way to tell vim to use certain settings like noexpandtab
based on if I'm under a certain directory tree or not. That way I just set it once in a config file and not have to think about it again on this workstation.