:verbose set shiftwidth
tells you what's the current value and where it was defined. See :help :verbose
.
Filetype plugins are sourced after the corresponding FileType
event was triggered so they will override the options in your vimrc
.
The dirty way to add filetype-specific settings to your config is to add something like this to your vimrc
:
augroup Python
autocmd!
autocmd fileType python setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab
augroup END
See :help :autocmd
.
The clean way is to put your desired settings into a custom ftplugin
.
The file:
~/.vim/after/ftplugin/python.vim
Its content:
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal expandtab
Note the use of setlocal
instead of set
because you don't want those settings to be applied everywhere.