@@ -128,13 +128,20 @@ have changed the indent by typing <BS>, <Tab>, or <Space> in the indent or
128128used CTRL-T or CTRL-D .
129129
130130 *cinoptions-values*
131- The 'cinoptions' option sets how Vim performs indentation. In the list below,
131+ The 'cinoptions' option sets how Vim performs indentation. The value after
132+ the option character can be one of these (N is any number):
133+ N indent N spaces
134+ -N indent N spaces to the left
135+ Ns N times 'shiftwidth spaces
136+ -Ns N times 'shiftwidth spaces to the left
137+
138+ In the list below,
132139"N" represents a number of your choice (the number can be negative). When
133140there is an 's' after the number, Vim multiplies the number by 'shiftwidth' :
134141"1s" is 'shiftwidth' , "2s" is two times 'shiftwidth' , etc. You can use a
135- decimal point, too: "-0.5s" is minus half a 'shiftwidth' . The examples below
136- assume a 'shiftwidth' of 4.
137-
142+ decimal point, too: "-0.5s" is minus half a 'shiftwidth' .
143+ The examples below assume a 'shiftwidth' of 4.
144+ *cino->*
138145 >N Amount added for "normal" indent. Used after a line that should
139146 increase the indent (lines starting with "if", an opening brace,
140147 etc.). (default 'shiftwidth' ).
@@ -145,6 +152,7 @@ assume a 'shiftwidth' of 4.
145152 foo; foo; foo;
146153 } } }
147154<
155+ *cino-e*
148156 eN Add N to the prevailing indent inside a set of braces if the
149157 opening brace at the End of the line (more precise: is not the
150158 first character in a line). This is useful if you want a
@@ -160,6 +168,7 @@ assume a 'shiftwidth' of 4.
160168 bar; bar; bar;
161169 } } }
162170<
171+ *cino-n*
163172 nN Add N to the prevailing indent for a statement after an "if",
164173 "while", etc., if it is NOT inside a set of braces. This is
165174 useful if you want a different indent when there is no '{'
@@ -174,6 +183,7 @@ assume a 'shiftwidth' of 4.
174183 bar; bar; bar;
175184 } } }
176185<
186+ *cino-f*
177187 fN Place the first opening brace of a function or other block in
178188 column N. This applies only for an opening brace that is not
179189 inside other braces and is at the start of the line. What comes
@@ -184,6 +194,7 @@ assume a 'shiftwidth' of 4.
184194 { { {
185195 int foo; int foo; int foo;
186196<
197+ *cino-{*
187198 {N Place opening braces N characters from the prevailing indent.
188199 This applies only for opening braces that are inside other
189200 braces. (default 0).
@@ -193,6 +204,7 @@ assume a 'shiftwidth' of 4.
193204 { { {
194205 foo; foo; foo;
195206<
207+ *cino-}*
196208 }N Place closing braces N characters from the matching opening
197209 brace. (default 0).
198210
@@ -202,6 +214,7 @@ assume a 'shiftwidth' of 4.
202214 foo; foo; foo;
203215 } } }
204216<
217+ *cino-^*
205218 ^N Add N to the prevailing indent inside a set of braces if the
206219 opening brace is in column 0. This can specify a different
207220 indent for whole of a function (some may like to set it to a
@@ -216,6 +229,7 @@ assume a 'shiftwidth' of 4.
216229 } } }
217230 } } }
218231<
232+ *cino-L*
219233 LN Controls placement of jump labels. If N is negative, the label
220234 will be placed at column 1. If N is non-negative, the indent of
221235 the label will be the prevailing indent minus N. (default -1).
@@ -229,6 +243,7 @@ assume a 'shiftwidth' of 4.
229243 } } }
230244 } } }
231245<
246+ *cino-:*
232247 :N Place case labels N characters from the indent of the switch().
233248 (default 'shiftwidth' ).
234249
@@ -240,13 +255,15 @@ assume a 'shiftwidth' of 4.
240255 default: default:
241256 } }
242257<
258+ *cino-=*
243259 =N Place statements occurring after a case label N characters from
244260 the indent of the label. (default 'shiftwidth' ).
245261
246262 cino= cino==10 >
247263 case 11: case 11: a = a + 1;
248264 a = a + 1; b = b + 1;
249265<
266+ *cino-l*
250267 lN If N != 0 Vim will align with a case label instead of the
251268 statement after it in the same line.
252269
@@ -256,6 +273,7 @@ assume a 'shiftwidth' of 4.
256273 break; break;
257274 } }
258275<
276+ *cino-b*
259277 bN If N != 0 Vim will align a final "break" with the case label,
260278 so that case..break looks like a sort of block. (default: 0).
261279 When using 1, consider adding "0=break" to 'cinkeys' .
@@ -272,6 +290,7 @@ assume a 'shiftwidth' of 4.
272290 break; break;
273291 } }
274292<
293+ *cino-g*
275294 gN Place C++ scope declarations N characters from the indent of the
276295 block they are in. (default 'shiftwidth' ). A scope declaration
277296 can be "public:", "protected:" or "private:".
@@ -283,6 +302,7 @@ assume a 'shiftwidth' of 4.
283302 private: private:
284303 } }
285304<
305+ *cino-h*
286306 hN Place statements occurring after a C++ scope declaration N
287307 characters from the indent of the label. (default
288308 'shiftwidth' ).
@@ -291,6 +311,21 @@ assume a 'shiftwidth' of 4.
291311 public: public: a = a + 1;
292312 a = a + 1; b = b + 1;
293313<
314+ *cino-N*
315+ NN Indent inside C++ namespace N characters extra compared to a
316+ normal block. (default 0).
317+
318+ cino= cino=N-s >
319+ namespace { namespace {
320+ void function(); void function();
321+ } }
322+
323+ namespace my namespace my
324+ { {
325+ void function(); void function();
326+ } }
327+ <
328+ *cino-p*
294329 pN Parameter declarations for K&R-style function declarations will
295330 be indented N characters from the margin. (default
296331 'shiftwidth' ).
@@ -300,13 +335,15 @@ assume a 'shiftwidth' of 4.
300335 int a; int a; int a;
301336 char b; char b; char b;
302337<
338+ *cino-t*
303339 tN Indent a function return type declaration N characters from the
304340 margin. (default 'shiftwidth' ).
305341
306342 cino= cino=t0 cino=t7 >
307343 int int int
308344 func() func() func()
309345<
346+ *cino-i*
310347 iN Indent C++ base class declarations and constructor
311348 initializations, if they start in a new line (otherwise they
312349 are aligned at the right side of the ':').
@@ -320,6 +357,7 @@ assume a 'shiftwidth' of 4.
320357 BaseClass(3) BaseClass(3)
321358 {} {}
322359<
360+ *cino-+*
323361 +N Indent a continuation line (a line that spills onto the next)
324362 inside a function N additional characters. (default
325363 'shiftwidth' ).
@@ -330,6 +368,7 @@ assume a 'shiftwidth' of 4.
330368 a = b + 9 * a = b + 9 *
331369 c; c;
332370<
371+ *cino-c*
333372 cN Indent comment lines after the comment opener, when there is no
334373 other text with which to align, N characters from the comment
335374 opener. (default 3). See also | format-comments | .
@@ -339,6 +378,7 @@ assume a 'shiftwidth' of 4.
339378 text. text.
340379 */ */
341380<
381+ *cino-C*
342382 CN When N is non-zero, indent comment lines by the amount specified
343383 with the c flag above even if there is other text behind the
344384 comment opener. (default 0).
@@ -349,12 +389,14 @@ assume a 'shiftwidth' of 4.
349389 ********/ ********/
350390< (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
351391
392+ *cino-/*
352393 /N Indent comment lines N characters extra. (default 0).
353394 cino= cino=/4 >
354395 a = b; a = b;
355396 /* comment */ /* comment */
356397 c = d; c = d;
357398<
399+ *cino-(*
358400 (N When in unclosed parentheses, indent N characters from the line
359401 with the unclosed parentheses. Add a 'shiftwidth' for every
360402 unclosed parentheses. When N is 0 or the unclosed parentheses
@@ -370,13 +412,15 @@ assume a 'shiftwidth' of 4.
370412 (c2 || c3)) (c2 || c3))
371413 { {
372414<
415+ *cino-u*
373416 uN Same as (N, but for one level deeper. (default 'shiftwidth' ).
374417
375418 cino= cino=u2 >
376419 if (c123456789 if (c123456789
377420 && (c22345 && (c22345
378421 || c3)) || c3))
379422<
423+ *cino-U*
380424 UN When N is non-zero, do not ignore the indenting specified by
381425 ( or u in case that the unclosed parentheses is the first
382426 non-white character in its line. (default 0).
@@ -388,6 +432,7 @@ assume a 'shiftwidth' of 4.
388432 c3 c3
389433 ) && c4; ) && c4;
390434<
435+ *cino-2*
391436 wN When in unclosed parentheses and N is non-zero and either
392437 using "(0" or "u0", respectively, or using "U0" and the unclosed
393438 parentheses is the first non-white character in its line, line
@@ -400,6 +445,7 @@ assume a 'shiftwidth' of 4.
400445 || c3)) || c3))
401446 foo; foo;
402447<
448+ *cino-W*
403449 WN When in unclosed parentheses and N is non-zero and either
404450 using "(0" or "u0", respectively and the unclosed parentheses is
405451 the last non-white character in its line and it is not the
@@ -414,6 +460,7 @@ assume a 'shiftwidth' of 4.
414460 a_short_line(argument, a_short_line(argument,
415461 argument); argument);
416462<
463+ *cino-m*
417464 mN When N is non-zero, line up a line starting with a closing
418465 parentheses with the first character of the line with the
419466 matching opening parentheses. (default 0).
@@ -428,6 +475,7 @@ assume a 'shiftwidth' of 4.
428475 ) )
429476 foo; foo;
430477<
478+ *cino-M*
431479 MN When N is non-zero, line up a line starting with a closing
432480 parentheses with the first character of the previous line.
433481 (default 0).
@@ -437,7 +485,7 @@ assume a 'shiftwidth' of 4.
437485 cond2 cond2
438486 ) )
439487<
440- *java-cinoptions* *java-indenting*
488+ *java-cinoptions* *java-indenting* *cino-j *
441489 jN Indent java anonymous classes correctly. The value 'N' is
442490 currently unused but must be non-zero (e.g. 'j1'). 'j1' will
443491 indent for example the following code snippet correctly: >
@@ -448,7 +496,7 @@ assume a 'shiftwidth' of 4.
448496 }
449497 });
450498<
451- *javascript-cinoptions* *javascript-indenting*
499+ *javascript-cinoptions* *javascript-indenting* *cino-J *
452500 JN Indent JavaScript object declarations correctly by not confusing
453501 them with labels. The value 'N' is currently unused but must be
454502 non-zero (e.g. 'J1'). >
@@ -466,24 +514,27 @@ assume a 'shiftwidth' of 4.
466514 }
467515 }
468516<
517+ *cino-)*
469518 )N Vim searches for unclosed parentheses at most N lines away.
470519 This limits the time needed to search for parentheses. (default
471520 20 lines).
472521
522+ *cino-star*
473523 *N Vim searches for unclosed comments at most N lines away. This
474524 limits the time needed to search for the start of a comment.
475525 If your /* */ comments stop indenting afer N lines this is the
476526 value you will want to change.
477527 (default 70 lines).
478528
529+ *cino-#*
479530 #N When N is non-zero recognize shell/Perl comments, starting with
480531 '#'. Default N is zero: don't recognizes '#' comments. Note
481532 that lines starting with # will still be seen as preprocessor
482533 lines.
483534
484535
485536The defaults, spelled out in full, are:
486- cinoptions=>s,e0,n0,f0,{0,} 0,^0,L-1,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,
537+ cinoptions=>s,e0,n0,f0,{0,} 0,^0,L-1,:s,=s,l0,b0,gs,hs,N0, ps,ts,is,+s,
487538 c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
488539
489540Vim puts a line in column 1 if:
0 commit comments