<tab>
, where others expect <4-spaces>.
I could not find a vim plugin or other extension that lets me pick vim-settings per git repository. The idea that I came up with, is to set the project specific vim-settings in the git-config itself. For example:
$ git config --add vim.settings 'tabstop=4 expandtab'
Now, in my ~/.vimrc
, I have the following snippet:
let git_settings = system("git config --get vim.settings")
if strlen(git_settings)
exe "set" git_settings
endif
Editing a file in the git repository that contains the above vim.settings, now replaces my <tab>
by <4-spaces>
. Other repositories that do not have the vim.settings
will fall-back to my vim defaults. If you can think of any improvements or suggestions, please share them.