xxxxxxxxxx
Be in visual mode (v).
Use the > command. To indent five lines, 5>>.
To mark a block of lines and indent it, Vjj> to indent three lines (Vim only).
To indent a curly-braces block, put your cursor
on one of the curly braces and use >% or from
anywhere inside block use >iB.
If you’re copying blocks of text around and need to
align the indent of a block in its new location, use
]p instead of just p. This aligns the pasted block with
the surrounding text.
xxxxxxxxxx
:set tabstop=8 - tabs are at proper location
:set expandtab - don't use actual tab character (ctrl-v)
:set shiftwidth=4 - indenting is 4 spaces
:set autoindent - turns it on
:set smartindent - does the right thing (mostly) in programs
:set cindent - stricter rules for C programs