Mercurial > vim
comparison runtime/doc/indent.txt @ 236:4707450c2b33
updated for version 7.0066
author | vimboss |
---|---|
date | Fri, 15 Apr 2005 21:00:38 +0000 |
parents | 8c60f65311fa |
children | ce2181d14aa0 |
comparison
equal
deleted
inserted
replaced
235:23d380e32c95 | 236:4707450c2b33 |
---|---|
1 *indent.txt* For Vim version 7.0aa. Last change: 2005 Feb 24 | 1 *indent.txt* For Vim version 7.0aa. Last change: 2005 Mar 29 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
235 case 1: { case 1: { | 235 case 1: { case 1: { |
236 break; break; | 236 break; break; |
237 } } | 237 } } |
238 < | 238 < |
239 bN If N != 0 Vim will align a final "break" with the case label, | 239 bN If N != 0 Vim will align a final "break" with the case label, |
240 so that case..break looks like a sort of block. (default: 0). | 240 so that case..break looks like a sort of block. (default: 0). |
241 | 241 |
242 cino= cino=b1 > | 242 cino= cino=b1 > |
243 switch (x) switch(x) | 243 switch (x) switch(x) |
244 { { | 244 { { |
245 case 1: case 1: | 245 case 1: case 1: |
323 /******** /******** | 323 /******** /******** |
324 text. text. | 324 text. text. |
325 ********/ ********/ | 325 ********/ ********/ |
326 < (Example uses ":set comments& comments-=s1:/* comments^=s0:/*") | 326 < (Example uses ":set comments& comments-=s1:/* comments^=s0:/*") |
327 | 327 |
328 /N Indent comment lines N characters extra. (default 0). | 328 /N Indent comment lines N characters extra. (default 0). |
329 cino= cino=/4 > | 329 cino= cino=/4 > |
330 a = b; a = b; | 330 a = b; a = b; |
331 /* comment */ /* comment */ | 331 /* comment */ /* comment */ |
332 c = d; c = d; | 332 c = d; c = d; |
333 < | 333 < |
379 WN When in unclosed parentheses and N is non-zero and either | 379 WN When in unclosed parentheses and N is non-zero and either |
380 using "(0" or "u0", respectively and the unclosed parentheses is | 380 using "(0" or "u0", respectively and the unclosed parentheses is |
381 the last non-white character in its line and it is not the | 381 the last non-white character in its line and it is not the |
382 closing parentheses, indent the following line N characters | 382 closing parentheses, indent the following line N characters |
383 relative to the outer context (i.e. start of the line or the | 383 relative to the outer context (i.e. start of the line or the |
384 next unclosed parentheses). (default: 0). | 384 next unclosed parentheses). (default: 0). |
385 | 385 |
386 cino=(0 cino=(0,W4 > | 386 cino=(0 cino=(0,W4 > |
387 a_long_line( a_long_line( | 387 a_long_line( a_long_line( |
388 argument, argument, | 388 argument, argument, |
389 argument); argument); | 389 argument); argument); |
404 ) ) | 404 ) ) |
405 foo; foo; | 405 foo; foo; |
406 < | 406 < |
407 *java-cinoptions* *java-indenting* | 407 *java-cinoptions* *java-indenting* |
408 jN Indent java anonymous classes correctly. The value 'N' is | 408 jN Indent java anonymous classes correctly. The value 'N' is |
409 currently unused but must be non-zero (e.g. 'j1'). 'j1' will | 409 currently unused but must be non-zero (e.g. 'j1'). 'j1' will |
410 indent for example the following code snippet correctly: > | 410 indent for example the following code snippet correctly: > |
411 | 411 |
412 object.add(new ChangeListener() { | 412 object.add(new ChangeListener() { |
413 public void stateChanged(ChangeEvent e) { | 413 public void stateChanged(ChangeEvent e) { |
414 do_something(); | 414 do_something(); |
449 REMARKS ABOUT SPECIFIC INDENT FILES ~ | 449 REMARKS ABOUT SPECIFIC INDENT FILES ~ |
450 | 450 |
451 | 451 |
452 FORTRAN *fortran-indent* | 452 FORTRAN *fortran-indent* |
453 | 453 |
454 Block if, select case, and where constructs are indented. Comments, labelled | 454 Block if, select case, and where constructs are indented. Comments, labelled |
455 statements and continuation lines are indented if the Fortran is in free | 455 statements and continuation lines are indented if the Fortran is in free |
456 source form, whereas they are not indented if the Fortran is in fixed source | 456 source form, whereas they are not indented if the Fortran is in fixed source |
457 form because of the left margin requirements. Hence manual indent corrections | 457 form because of the left margin requirements. Hence manual indent corrections |
458 will be necessary for labelled statements and continuation lines when fixed | 458 will be necessary for labelled statements and continuation lines when fixed |
459 source form is being used. For further discussion of the method used for the | 459 source form is being used. For further discussion of the method used for the |
460 detection of source format see |fortran-syntax|. | 460 detection of source format see |fortran-syntax|. |
461 | 461 |
462 Do loops ~ | 462 Do loops ~ |
463 All do loops are left unindented by default. Do loops can be unstructured in | 463 All do loops are left unindented by default. Do loops can be unstructured in |
464 Fortran with (possibly multiple) loops ending on a labelled executable | 464 Fortran with (possibly multiple) loops ending on a labelled executable |
465 statement of almost arbitrary type. Correct indentation requires | 465 statement of almost arbitrary type. Correct indentation requires |
466 compiler-quality parsing. Old code with do loops ending on labelled statements | 466 compiler-quality parsing. Old code with do loops ending on labelled statements |
467 of arbitrary type can be indented with elaborate programs such as Tidy | 467 of arbitrary type can be indented with elaborate programs such as Tidy |
468 (http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are | 468 (http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are |
469 also left unindented because continue statements are also used for purposes | 469 also left unindented because continue statements are also used for purposes |
470 other than ending a do loop. Programs such as Tidy can convert structured | 470 other than ending a do loop. Programs such as Tidy can convert structured |
471 do/continue loops to the do/enddo form. Do loops of the do/enddo variety can | 471 do/continue loops to the do/enddo form. Do loops of the do/enddo variety can |
472 be indented. If you use only structured loops of the do/enddo form, you should | 472 be indented. If you use only structured loops of the do/enddo form, you should |
473 declare this by setting the fortran_do_enddo variable in your .vimrc as | 473 declare this by setting the fortran_do_enddo variable in your .vimrc as |
474 follows > | 474 follows > |
475 | 475 |
476 let fortran_do_enddo=1 | 476 let fortran_do_enddo=1 |
477 | 477 |
478 in which case do loops will be indented. If all your loops are of do/enddo | 478 in which case do loops will be indented. If all your loops are of do/enddo |
479 type only in, say, .f90 files, then you should set a buffer flag with an | 479 type only in, say, .f90 files, then you should set a buffer flag with an |
480 autocommand such as > | 480 autocommand such as > |
481 | 481 |
482 au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1 | 482 au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1 |
483 | 483 |