2

Indentation of C++ (and also C, Objective-C and even Java) is typically handled by enabling the 'cindent' option, which uses Vim's built-in C-indenting implementation, which recognizes elements of these languages (such as curly braces, semi-colons, etc.) and uses them as cues to decide whether to indent or unindent a specific line. This indentation engine ...


1

I am referring to both the behavior when pressing Enter in insert mode, and also the behavior when pressing = in Visual mode. The "equal" command depends on :h 'equalprg' option value. If it's set then Vim invokes an external formatter program, and all those indents will be set according to that program's configuration. In fact, you may end up ...


Only top voted, non community-wiki answers of a minimum length are eligible