Mercurial > vim
comparison runtime/doc/indent.txt @ 1668:0b796e045c42 v7.2b.000
updated for version 7.2b-000
author | vimboss |
---|---|
date | Sun, 13 Jul 2008 17:41:49 +0000 |
parents | 73fe8baea242 |
children | f4f8014d516e |
comparison
equal
deleted
inserted
replaced
1667:131dbd3d2a4b | 1668:0b796e045c42 |
---|---|
1 *indent.txt* For Vim version 7.2a. Last change: 2008 Jun 21 | 1 *indent.txt* For Vim version 7.2b. Last change: 2008 Jun 30 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
504 | 504 |
505 to get do loops indented in .f90 files and left alone in Fortran files with | 505 to get do loops indented in .f90 files and left alone in Fortran files with |
506 other extensions such as .for. | 506 other extensions such as .for. |
507 | 507 |
508 | 508 |
509 PHP *ft-php-indent* *php-indent* *php-indenting* | |
510 | |
511 NOTE: PHP files will be indented correctly only if PHP |syntax| is active. | |
512 | |
513 If you are editing a file in Unix 'fileformat' and '\r' characters are present | |
514 before new lines, indentation won't proceed correctly ; you have to remove | |
515 those useless characters first with a command like: > | |
516 | |
517 :%s /\r$//g | |
518 | |
519 Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the | |
520 script will silently remove them when Vim loads a PHP file (at each|BufRead|). | |
521 | |
522 OPTIONS: ~ | |
523 | |
524 PHP indenting can be altered in several ways by modifying the values of some | |
525 variables: | |
526 | |
527 *php-comment* | |
528 To not enable auto-formating of comments by default (if you want to use your | |
529 own 'formatoptions'): > | |
530 :let g:PHP_autoformatcomment = 0 | |
531 | |
532 Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be | |
533 added, see|fo-table|for more information. | |
534 ------------- | |
535 | |
536 To add an extra indent to every PHP lines with N being the number of | |
537 'shiftwidth' to add: > | |
538 :let g:PHP_default_indenting = N | |
539 | |
540 For example, with N = 1, this will give: | |
541 > | |
542 <?php | |
543 if (!isset($History_lst_sel)) | |
544 if (!isset($History_lst_sel)) | |
545 if (!isset($History_lst_sel)) { | |
546 $History_lst_sel=0; | |
547 } else | |
548 $foo="bar"; | |
549 | |
550 $command_hist = TRUE; | |
551 ?> | |
552 (Notice the extra indent between the PHP container markers and the code) | |
553 ------------- | |
554 | |
555 To automatically remove '\r' characters when the 'fileformat' is set to Unix: > | |
556 :let g:PHP_removeCRwhenUnix = 1 | |
557 ------------- | |
558 | |
559 To indent braces at the same level than the code they contain: > | |
560 :let g:PHP_BracesAtCodeLevel = 1 | |
561 | |
562 This will give the following result: > | |
563 if ($foo) | |
564 { | |
565 foo(); | |
566 } | |
567 Instead of: > | |
568 if ($foo) | |
569 { | |
570 foo(); | |
571 } | |
572 | |
573 NOTE: Indenting will be a bit slower if this option is used because some | |
574 optimizations won't be available. | |
575 ------------- | |
576 | |
577 To indent 'case:' and 'default:' statements in switch() blocks: > | |
578 :let g:PHP_vintage_case_default_indent = 1 | |
579 | |
580 (By default they are indented at the same level than the 'switch()' to avoid | |
581 unnecessary indentation) | |
582 | |
583 | |
509 PYTHON *ft-python-indent* | 584 PYTHON *ft-python-indent* |
510 | 585 |
511 The amount of indent can be set for the following situations. The examples | 586 The amount of indent can be set for the following situations. The examples |
512 given are de the defaults. Note that the variables are set to an expression, | 587 given are de the defaults. Note that the variables are set to an expression, |
513 so that you can change the value of 'shiftwidth' later. | 588 so that you can change the value of 'shiftwidth' later. |