Here is an example of line continuation:
ThisIsASuperLongClassNameWithALotOfExtraCharacters thisIsALongVariableName =
ThisIsAModeratelyLongSuperClass.longFunctionCall(
thisIsAVeryLongVariableNameThatCanSpanAFullLineByItself);
Here is an example of an indented block:
if (x == 5) {
fetchBob()
}
Typically, for all the settings of cindent
and smartindent
I've tried so far, Vim treats these two cases identically and adds the same amount of space in each case. To be explicit, I am referring to both the behavior when pressing Enter
in insert mode, and also the behavior when pressing =
in Visual mode.
Is there some magic combination of cindent
and smartindent
or another setting that will cause vim to automatically add 4 spaces in the line continuation case and 2 spaces in the indented block case?