As mentioned in :h softtabstop, the softtabstop indicates how many columns vim uses when you enter <Tab> in insert mode. Although it performs like <Tab> inserted, in fact, the vim mixes <BS> or <Tab> for that.
If you hit <Tab> in insert mode, the vim will act like:
if set expandtab
always uses <BS>
else
if softtabstop == 0
always uses <Tab> // the number of columns is equal to tabstop
else if softtabstop < 0
the number of columns for <Tab> is equal to :shiftwidth
&& uses a mix of <BS> and <Tab>
else
uses a mix of <BS> and <Tab>
end
end
For example,
In :set noexpandtab shiftwidth=4 tabstop=4 softtabstop=2 case, the value of tabstop is large than the value of softtabstop, the vim will use two <BS> chars to represent one hit <Tab>.
In :set noexpandtab shiftwidth=4 tabstop=2 softtabstop=2 case, the value of tabstop is equal to the value of softtabstop, the vim will use one <Tab> char to perform one hit <Tab>.
In :set noexpandtab shiftwidth=4 tabstop=2 softtabstop=3 case, the value of tabstop is less than the value of softtabstop, the vim will use one <Tab> char and one <BS> char to perform one hit <Tab>.
In :set noexpandtab shiftwidth=4 tabstop=2 softtabstop=0 case, the value of softtabstop is zero, the vim always uses <Tab>.
Therefore, in your case, :set noexpandtab shiftwidth=4 tabstop=4 softtabstop=0 does equal to :set noexpandtab shiftwidth=4 tabstop=4 softtabstop=4.
In my opinion, it's better to use tabstop == softtabstop if you want to handle with <Tab>. Because the vim will not use a mix solution.
sts=0prevents<Tab>from working? – romainl Sep 03 '16 at 07:42tabstopsimply defines the width of thetabcharacter(for examplets=4means that it is four columns wide) whilesofttabstopactually defines amount of tabs and spaces inserted if<Tab>key is pressed. For example ifts=4andsts=1and one presses the<Tab>key, then only a single space character is inserted. Now if one makes another three spaces, then those are converted to singletab. This made me think that ifsts=0, then nothing happens if<Tab>is pressed. – Martin Sep 03 '16 at 11:15softtabstopto -1,shiftwidthto 0 and both options will then follow, whatever yourtabstopsetting is – Christian Brabandt Sep 03 '16 at 11:29<Tab>key insertstabcharacter or spaces(ifexpandtabis on) ifsts=0. After all,stscontrols how many columns vim uses when one hits<Tab>in insert mode and ifsts=0, then IMHO it's logical to expect no characters when<Tab>key is pressed. – Martin Sep 03 '16 at 17:22