For some reasons when I'm editing my ~/.config/nvim/init.vim
, it adds 8 spaces even though I set set tabstop=4
on the file. Actually, :verbose set tabstop
returns 4, so it should be 4 spaces.
I already read the questions here and here, and strangely, in Python I have no problem on adding 4 spaces.
What is causing the problem? How can I investigate the problem further and fix it up?
Tab
. That is, unless you have some other settings with non-default values...particularaly'expandtabs'
. And what do you have for'softtabstop'
,'shiftwidth'
,'cpoptions'
while we're at it? This is only for*.vim
files? Only when you simply hit Tab in Insert mode or other circumstances (e.g. autoindent scenarios)?:setlocal
and would show up as the value returned by:set tabstop
... OP said that returns 4.'smarttab'
, too @Blaszard.softtabstop
is 4, and I found that theshiftwidth
is set to 8. Setting it to 4 solved the problem, thanks.