I am on CentOS 8.1 and using vim 8.0.1763. When I open a python file, e.g. vim tmp.py
, I type tab
and it inserts 4 spaces (see .vimrc
below). When I type delete
, it deletes all 4 spaces. I want it to delete only one space. I'm pretty sure this was the case in vim 7.4.629. In vim 8.0.1763, it deletes only one space if it is a .txt
file but 4 if it is a .py
file.
.vimrc
set number
filetype plugin on
syntax on
set paste
set formatoptions-=tc
set ruler
set showmatch
set expandtab
set tabstop=4
Question :
How do I get vim to only delete one space in python files? I assume this is set in /usr/share/vim/vim80/syntax/python.vi
, but I'm not particularly familiar with the vim language.
'softtabstop'
set to non-zero? Try setting to 0. Whether doing that will disable other functionality you want is something only you can answer. You should read the docs for it. (If this is the cause.)softtabstop=0
does not help the situationsofttabstop=0
, does solve the problem. But I have to set it the session with the open file. I'm not sure why it won't get set when I add it to my.vimrc
.