I read the wiki entry on vim source code indentation
I still can't understand the difference between
It seems they do the same thing, copy the indentation level to next line when you press
autoindent essentially tells vim to apply the indentation of the current line to the next (created by pressing enter in insert mode or with O or o in normal mode.
smartindent reacts to the syntax/style of the code you are editing (especially for C). When having it on you also should have
:help autoindent also mentions two alternative settings:
indentexpr, both of which make vim ignore the value of