I am using vim 8.0.1763
on CentOS 8.1. Here is my ~/.vimrc
" Cool vim plugins : http://vimawesome.com/plugin/fugitive-vim
set number
filetype plugin on " https://stackoverflow.com/questions/19754849/vim-syntax-highlighting-does-not-work
syntax on
" Stop annoying line wrapping when pasting
set paste
" Stop annoying line wrapping
set formatoptions-=tc
set ruler
set showmatch
set expandtab
set tabstop=4
set softtabstop=0
If I open a *.py
file, and type :set softtabstop
it returns 4. If I open another *.txt
file, the same command returns 0. Clearly this is a python file specific behavior. The only place I can find this being set is in /usr/share/vim/vim80/ftplugin/python.vim
My intuition says that .vimrc
should be loaded last.
Question
- How do I get my settings in my
.vimrc
file to persist when opening*.py
files? - What is the order of operation when loading vim configuration files?
Note :
This question was incorrectly marked as a duplicate question. The accepted answer of adding
augroup python
autocmd!
autocmd FileType python setlocal noet ts=4
augroup end
to my ~/.vimrc
does not solve the Question 1 that I pose above. Also the previously previously asked question does not address my Question 2.
My question is unique in its own right. The accepted answer of my question is unique and not given in the previously asked question. My question should not be closed.
tabstop=4
, and notsofttabstop=0
as you want; this is just an example and should be adjusted according to personal preference (it won't work for people who want a tabstop of 2 either). I'll add a line to clarify that a bit.