Friday, 23 August 2013

autoindent is subset of smartindent in vim?

autoindent is subset of smartindent in vim?

:help autoindent : Copy indent from current line when starting a new line
(typing in Insert mode or when using the "o" or "O" command). ...
:help smartindent : Do smart autoindenting when starting a new line. Works
for C-like programs, but can also be used for other languages. ...
Normally 'autoindent' should also be on when using 'smartindent'. An
indent is automatically inserted:
After a line ending in '{'.
After a line starting with a keyword from 'cinwords'.
Before a line starting with '}' (only with the "O" command).
When typing '}' as the first character in a new line, that line is given
the same indent as the matching '{'. ...
smartindent also coping indent from current line when starting a new line.
That means autoindent feature is subset of smartindent feature and no need
of autoindent if smartindent is on, right? Why autoindent should be turn
on?

No comments:

Post a Comment