I installed vundle yesterday and since I did, the tabwidth I configured in my vimrc is ignored and set back to 4 instead of 2.
I found out that the following line after the vundle paragraph is causing it:
filetype plugin indent on
My indentation is set up like this:
set noexpandtab " Make sure that every file uses real tabs, not spaces
set shiftround " Round indent to multiple of 'shiftwidth'
set smartindent " Do smart indenting when starting a new line
set autoindent " Copy indent from current line, over to the new line
" Set the tab width
let s:tabwidth=2
exec 'set tabstop=' .s:tabwidth
exec 'set shiftwidth=' .s:tabwidth
exec 'set softtabstop='.s:tabwidth
You can check my full vimrc here.
I tested the indentation problem using a python script (where indentation really matters).
I already tried changing filetype plugin indent on
to filetype plugin on
but that doesn't change anything. Only commenting out that line helps.
Now, the vundle install guide says, this line is required.
How do I fix this indent issue? Can I just ommit the filetype line or is it really mandatory to keep it in the vimrc?
Solution:
Thanks to @ChristianBrabandt and @romainl I now found a solution that can also reside in a single vimrc file:
filetype plugin indent on
[...]
set noexpandtab " Make sure that every file uses real tabs, not spaces
set shiftround " Round indent to multiple of 'shiftwidth'
set autoindent " Copy indent from current line, over to the new line
" Set the tab width
let s:tabwidth=2
au Filetype * let &l:tabstop = s:tabwidth
au Filetype * let &l:shiftwidth = s:tabwidth
au Filetype * let &l:softtabstop = s:tabwidth