I am editing a python file. My current settings for tabstop are as follows(just experimenting things):
- ~/.vimrc:
set tabstop=4 - ~/.vim/ftplugin/python.vim:
set tabstop=2 - There is no ~/.vim/after/plugin/python.vim file
set tabstop? shows tabstop=8
verbose set tabstop? shows tabstop=8. Last set from /usr/share/vim/vim80/ftplugin/python.vim
My questions:
- Why is
tabstopsettings at 8 even though i have explicitly set it to4in.vimrcfile or2in~/.vim/ftplugin/python.vimfile - When is each of the files i.e.
~/.vimrc,~/.vim/ftplugin/python.vim,~/.vim/after/plugin/python.vim,/usr/share/vim/vim80/ftplugin/python.vimloaded? - Which file takes priority and where should I define my settings to override the others?
- How is
setdifferent fromset local?
It would be great if someone answers all these questions. It will surely benefit people especially Vim beginner and intermediate users as all of these concepts are inter-related
tabstopis the width of space represented by a tab character in the file, but the width of space inserted when you press Tab on your keyboard is controlled bysofttabstop(if it's set to a non-zero value). Nothing weird is going on with order of evaluation, orsetlocal, or any of the other things you're asking about.See also What is
softtabstopused for? on the Vim StackExchange.