Vim indentation options
Posted on
tabstop
: how many columns a tab should be made up of in the editor view.expandtab
: when enabled, insert the appropriate number of spaces when in insert mode.shiftwidth
: how many columns text will be indented when using indent operations (such as<<
or>>
) in normal or visual modesofttabstop
: when enabled,softtabstop
<tabstop
&&noexpandtab
, this will result in a combination of tabs and spaces to make up the total spacing .softtabstop
==tabstop
&&noexpandtab
, this will always force the use of tabs.expandtab
, the value ofsofttabstop
will be ignored and spaces will be forced
shifround
: round indent to nearest multiple of setshiftwidth
on indent operations (>>
<<
in Normal mode,CTRL-T
CTRL-D
in Insert mode)
Source: A byte of Lox (Tabs, stop! The truth about tab and spaces in Vim)