I'm having trouble making indentation work as I expect in Vim.
Short version: What I want is to disable Tab mark.
Long version: What I want is to ALWAYS insert four spaces when indenting (i.e. when hitting <Tab>
AND when using >>
).
Actually, the second part is working.
The problem comes from the <Tab>
part: when hitting <Tab>
, it inserts between 1 and 4 spaces to go to the next Tab mark. And I don't want that.
Actually, my Vim indentation parameters in .vimrc
are:
set expandtab # To get spaces instead of Tab
set tabstop=4 # What actually is giving me trouble
# set softtabstop=-1 # I also tried this one but it gives me the same result
set shiftwidth=4 # To get 4 spaces Tab
I checked the others indentation parameters using:
:verbose set sr? ai? cin? cink? cino? si? inde? indk?
Which result was:
noshiftround
noautoindent
nocindent
cinkeys=0{,0},0),:,0#,!^F,o,O,e
cinoption=
nosmartindent
indentexpr=
indentkeys=0{,0},:,0#,!^F,o,O,e
(If you're actually asking yourself why someone would be foul enough to want that, I'm writing some Robot Framework code in Vim and parameter separator are multiple spaces or tab. So when the Tab mark is 1 space after, it doesn't insert enough spaces.)