Mercurial > vim
comparison runtime/doc/syntax.txt @ 1624:18ee39301b82 v7.2a
updated for version 7.2a
author | vimboss |
---|---|
date | Tue, 24 Jun 2008 22:58:06 +0000 |
parents | d787f6c4c481 |
children | 0b796e045c42 |
comparison
equal
deleted
inserted
replaced
1623:53938adac247 | 1624:18ee39301b82 |
---|---|
1 *syntax.txt* For Vim version 7.1. Last change: 2007 May 11 | 1 *syntax.txt* For Vim version 7.2a. Last change: 2008 Jun 21 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
101 \ else <Bar> | 101 \ else <Bar> |
102 \ syntax enable <Bar> | 102 \ syntax enable <Bar> |
103 \ endif <CR> | 103 \ endif <CR> |
104 [using the |<>| notation, type this literally] | 104 [using the |<>| notation, type this literally] |
105 | 105 |
106 Details | 106 Details: |
107 The ":syntax" commands are implemented by sourcing a file. To see exactly how | 107 The ":syntax" commands are implemented by sourcing a file. To see exactly how |
108 this works, look in the file: | 108 this works, look in the file: |
109 command file ~ | 109 command file ~ |
110 :syntax enable $VIMRUNTIME/syntax/syntax.vim | 110 :syntax enable $VIMRUNTIME/syntax/syntax.vim |
111 :syntax on $VIMRUNTIME/syntax/syntax.vim | 111 :syntax on $VIMRUNTIME/syntax/syntax.vim |
529 Replace "nasm" with the name of the real assembly syntax. This line must be | 529 Replace "nasm" with the name of the real assembly syntax. This line must be |
530 one of the first five lines in the file. | 530 one of the first five lines in the file. |
531 | 531 |
532 The syntax type can always be overruled for a specific buffer by setting the | 532 The syntax type can always be overruled for a specific buffer by setting the |
533 b:asmsyntax variable: > | 533 b:asmsyntax variable: > |
534 :let b:asmsyntax=nasm | 534 :let b:asmsyntax = "nasm" |
535 | 535 |
536 If b:asmsyntax is not set, either automatically or by hand, then the value of | 536 If b:asmsyntax is not set, either automatically or by hand, then the value of |
537 the global variable asmsyntax is used. This can be seen as a default assembly | 537 the global variable asmsyntax is used. This can be seen as a default assembly |
538 language: > | 538 language: > |
539 :let asmsyntax=nasm | 539 :let asmsyntax = "nasm" |
540 | 540 |
541 As a last resort, if nothing is defined, the "asm" syntax is used. | 541 As a last resort, if nothing is defined, the "asm" syntax is used. |
542 | 542 |
543 | 543 |
544 Netwide assembler (nasm.vim) optional highlighting ~ | 544 Netwide assembler (nasm.vim) optional highlighting ~ |
611 | 611 |
612 C *c.vim* *ft-c-syntax* | 612 C *c.vim* *ft-c-syntax* |
613 | 613 |
614 A few things in C highlighting are optional. To enable them assign any value | 614 A few things in C highlighting are optional. To enable them assign any value |
615 to the respective variable. Example: > | 615 to the respective variable. Example: > |
616 :let c_comment_strings=1 | 616 :let c_comment_strings = 1 |
617 To disable them use ":unlet". Example: > | 617 To disable them use ":unlet". Example: > |
618 :unlet c_comment_strings | 618 :unlet c_comment_strings |
619 | 619 |
620 Variable Highlight ~ | 620 Variable Highlight ~ |
621 c_gnu GNU gcc specific items | 621 c_gnu GNU gcc specific items |
624 c_no_trail_space_error ... but no trailing spaces | 624 c_no_trail_space_error ... but no trailing spaces |
625 c_no_tab_space_error ... but no spaces before a <Tab> | 625 c_no_tab_space_error ... but no spaces before a <Tab> |
626 c_no_bracket_error don't highlight {}; inside [] as errors | 626 c_no_bracket_error don't highlight {}; inside [] as errors |
627 c_no_curly_error don't highlight {}; inside [] and () as errors; | 627 c_no_curly_error don't highlight {}; inside [] and () as errors; |
628 except { and } in first column | 628 except { and } in first column |
629 c_curly_error highlight a missing }; this forces syncing from the | |
630 start of the file, can be slow | |
629 c_no_ansi don't do standard ANSI types and constants | 631 c_no_ansi don't do standard ANSI types and constants |
630 c_ansi_typedefs ... but do standard ANSI types | 632 c_ansi_typedefs ... but do standard ANSI types |
631 c_ansi_constants ... but do standard ANSI constants | 633 c_ansi_constants ... but do standard ANSI constants |
632 c_no_utf don't highlight \u and \U in strings | 634 c_no_utf don't highlight \u and \U in strings |
633 c_syntax_for_h use C syntax for *.h files, instead of C++ | 635 c_syntax_for_h use C syntax for *.h files, instead of C++ |
672 highlighting for cErrInParen and cErrInBracket. | 674 highlighting for cErrInParen and cErrInBracket. |
673 | 675 |
674 If you want to use folding in your C files, you can add these lines in a file | 676 If you want to use folding in your C files, you can add these lines in a file |
675 an the "after" directory in 'runtimepath'. For Unix this would be | 677 an the "after" directory in 'runtimepath'. For Unix this would be |
676 ~/.vim/after/syntax/c.vim. > | 678 ~/.vim/after/syntax/c.vim. > |
677 syn region myFold start="{" end="}" transparent fold | |
678 syn sync fromstart | 679 syn sync fromstart |
679 set foldmethod=syntax | 680 set foldmethod=syntax |
680 | 681 |
681 CH *ch.vim* *ft-ch-syntax* | 682 CH *ch.vim* *ft-ch-syntax* |
682 | 683 |
1473 Debug, DebugSpecial, DebugString, DebugBoolean, DebugType | 1474 Debug, DebugSpecial, DebugString, DebugBoolean, DebugType |
1474 which are used for the statement itself, special characters used in debug | 1475 which are used for the statement itself, special characters used in debug |
1475 strings, strings, boolean constants and types (this, super) respectively. I | 1476 strings, strings, boolean constants and types (this, super) respectively. I |
1476 have opted to chose another background for those statements. | 1477 have opted to chose another background for those statements. |
1477 | 1478 |
1478 In order to help you to write code that can be easily ported between | 1479 In order to help you write code that can be easily ported between Java and |
1479 Java and C++, all C++ keywords are marked as error in a Java program. | 1480 C++, all C++ keywords can be marked as an error in a Java program. To |
1480 However, if you use them regularly, you may want to define the following | 1481 have this add this line in your .vimrc file: > |
1481 variable in your .vimrc file: > | 1482 :let java_allow_cpp_keywords = 0 |
1482 :let java_allow_cpp_keywords=1 | |
1483 | 1483 |
1484 Javadoc is a program that takes special comments out of Java program files and | 1484 Javadoc is a program that takes special comments out of Java program files and |
1485 creates HTML pages. The standard configuration will highlight this HTML code | 1485 creates HTML pages. The standard configuration will highlight this HTML code |
1486 similarly to HTML files (see |html.vim|). You can even add Javascript | 1486 similarly to HTML files (see |html.vim|). You can even add Javascript |
1487 and CSS inside this code (see below). There are four differences however: | 1487 and CSS inside this code (see below). There are four differences however: |
2400 (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) | 2400 (Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>) |
2401 | 2401 |
2402 | 2402 |
2403 SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* | 2403 SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* |
2404 | 2404 |
2405 This covers the "normal" Unix (Borne) sh, bash and the Korn shell. | 2405 This covers the "normal" Unix (Bourne) sh, bash and the Korn shell. |
2406 | 2406 |
2407 Vim attempts to determine which shell type is in use by specifying that | 2407 Vim attempts to determine which shell type is in use by specifying that |
2408 various filenames are of specific types: > | 2408 various filenames are of specific types: > |
2409 | 2409 |
2410 ksh : .kshrc* *.ksh | 2410 ksh : .kshrc* *.ksh |
2423 let g:is_kornshell = 1 | 2423 let g:is_kornshell = 1 |
2424 < posix: (using this is the same as setting is_kornshell to 1) > | 2424 < posix: (using this is the same as setting is_kornshell to 1) > |
2425 let g:is_posix = 1 | 2425 let g:is_posix = 1 |
2426 < bash: > | 2426 < bash: > |
2427 let g:is_bash = 1 | 2427 let g:is_bash = 1 |
2428 < sh: (default) Borne shell > | 2428 < sh: (default) Bourne shell > |
2429 let g:is_sh = 1 | 2429 let g:is_sh = 1 |
2430 | 2430 |
2431 If there's no "#! ..." line, and the user hasn't availed himself/herself of a | 2431 If there's no "#! ..." line, and the user hasn't availed himself/herself of a |
2432 default sh.vim syntax setting as just shown, then syntax/sh.vim will assume | 2432 default sh.vim syntax setting as just shown, then syntax/sh.vim will assume |
2433 the Borne shell syntax. No need to quote RFCs or market penetration | 2433 the Bourne shell syntax. No need to quote RFCs or market penetration |
2434 statistics in error reports, please -- just select the default version of | 2434 statistics in error reports, please -- just select the default version of the |
2435 the sh your system uses in your <.vimrc>. | 2435 sh your system uses in your <.vimrc>. |
2436 | 2436 |
2437 If, in your <.vimrc>, you set > | 2437 The syntax/sh.vim file provides several levels of syntax-based folding: > |
2438 let g:sh_fold_enabled= 1 | 2438 |
2439 let g:sh_fold_enabled= 0 (default, no syntax folding) | |
2440 let g:sh_fold_enabled= 1 (enable function folding) | |
2441 let g:sh_fold_enabled= 2 (enable heredoc folding) | |
2442 let g:sh_fold_enabled= 4 (enable if/do/for folding) | |
2439 > | 2443 > |
2440 then various syntax items (HereDocuments and function bodies) become | 2444 then various syntax items (HereDocuments and function bodies) become |
2441 syntax-foldable (see |:syn-fold|). | 2445 syntax-foldable (see |:syn-fold|). You also may add these together |
2442 | 2446 to get multiple types of folding: > |
2443 If you notice highlighting errors while scrolling backwards, which are fixed | 2447 |
2444 when redrawing with CTRL-L, try setting the "sh_minlines" internal variable | 2448 let g:sh_fold_enabled= 3 (enables function and heredoc folding) |
2449 | |
2450 If you notice highlighting errors while scrolling backwards which are fixed | |
2451 when one redraws with CTRL-L, try setting the "sh_minlines" internal variable | |
2445 to a larger number. Example: > | 2452 to a larger number. Example: > |
2446 | 2453 |
2447 let sh_minlines = 500 | 2454 let sh_minlines = 500 |
2448 | 2455 |
2449 This will make syntax synchronization start 500 lines before the first | 2456 This will make syntax synchronization start 500 lines before the first |
2502 Vim currently has SQL support for a variety of different vendors via syntax | 2509 Vim currently has SQL support for a variety of different vendors via syntax |
2503 scripts. You can change Vim's default from Oracle to any of the current SQL | 2510 scripts. You can change Vim's default from Oracle to any of the current SQL |
2504 supported types. You can also easily alter the SQL dialect being used on a | 2511 supported types. You can also easily alter the SQL dialect being used on a |
2505 buffer by buffer basis. | 2512 buffer by buffer basis. |
2506 | 2513 |
2507 For more detailed instructions see |sql.txt|. | 2514 For more detailed instructions see |ft_sql.txt|. |
2508 | 2515 |
2509 | 2516 |
2510 TCSH *tcsh.vim* *ft-tcsh-syntax* | 2517 TCSH *tcsh.vim* *ft-tcsh-syntax* |
2511 | 2518 |
2512 This covers the shell named "tcsh". It is a superset of csh. See |csh.vim| | 2519 This covers the shell named "tcsh". It is a superset of csh. See |csh.vim| |
2529 number is that redrawing can become slow. | 2536 number is that redrawing can become slow. |
2530 | 2537 |
2531 | 2538 |
2532 TEX *tex.vim* *ft-tex-syntax* | 2539 TEX *tex.vim* *ft-tex-syntax* |
2533 | 2540 |
2534 *tex-folding* | 2541 *tex-folding* |
2535 Want Syntax Folding? ~ | 2542 Want Syntax Folding? ~ |
2536 | 2543 |
2537 As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, | 2544 As of version 28 of <syntax/tex.vim>, syntax-based folding of parts, chapters, |
2538 sections, subsections, etc are supported. Put > | 2545 sections, subsections, etc are supported. Put > |
2539 let g:tex_fold_enabled=1 | 2546 let g:tex_fold_enabled=1 |
2540 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a | 2547 in your <.vimrc>, and :set fdm=syntax. I suggest doing the latter via a |
2541 modeline at the end of your LaTeX file: > | 2548 modeline at the end of your LaTeX file: > |
2542 % vim: fdm=syntax | 2549 % vim: fdm=syntax |
2543 < | 2550 < |
2544 *tex-runon* | 2551 *tex-nospell* |
2552 Don't Want Spell Checking In Comments? ~ | |
2553 | |
2554 Some folks like to include things like source code in comments and so would | |
2555 prefer that spell checking be disabled in comments in LaTeX files. To do | |
2556 this, put the following in your <.vimrc>: > | |
2557 let g:tex_comment_nospell= 1 | |
2558 < | |
2559 *tex-runon* | |
2545 Run-on Comments/Math? ~ | 2560 Run-on Comments/Math? ~ |
2546 | 2561 |
2547 The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The | 2562 The <syntax/tex.vim> highlighting supports TeX, LaTeX, and some AmsTeX. The |
2548 highlighting supports three primary zones/regions: normal, texZone, and | 2563 highlighting supports three primary zones/regions: normal, texZone, and |
2549 texMathZone. Although considerable effort has been made to have these zones | 2564 texMathZone. Although considerable effort has been made to have these zones |
2552 special "TeX comment" has been provided > | 2567 special "TeX comment" has been provided > |
2553 %stopzone | 2568 %stopzone |
2554 which will forcibly terminate the highlighting of either a texZone or a | 2569 which will forcibly terminate the highlighting of either a texZone or a |
2555 texMathZone. | 2570 texMathZone. |
2556 | 2571 |
2557 *tex-slow* | 2572 *tex-slow* |
2558 Slow Syntax Highlighting? ~ | 2573 Slow Syntax Highlighting? ~ |
2559 | 2574 |
2560 If you have a slow computer, you may wish to reduce the values for > | 2575 If you have a slow computer, you may wish to reduce the values for > |
2561 :syn sync maxlines=200 | 2576 :syn sync maxlines=200 |
2562 :syn sync minlines=50 | 2577 :syn sync minlines=50 |
2563 (especially the latter). If your computer is fast, you may wish to | 2578 (especially the latter). If your computer is fast, you may wish to |
2564 increase them. This primarily affects synchronizing (i.e. just what group, | 2579 increase them. This primarily affects synchronizing (i.e. just what group, |
2565 if any, is the text at the top of the screen supposed to be in?). | 2580 if any, is the text at the top of the screen supposed to be in?). |
2566 | 2581 |
2567 *tex-morecommands* *tex-package* | 2582 *tex-morecommands* *tex-package* |
2568 Wish To Highlight More Commmands? ~ | 2583 Want To Highlight More Commands? ~ |
2569 | 2584 |
2570 LaTeX is a programmable language, and so there are thousands of packages full | 2585 LaTeX is a programmable language, and so there are thousands of packages full |
2571 of specialized LaTeX commands, syntax, and fonts. If you're using such a | 2586 of specialized LaTeX commands, syntax, and fonts. If you're using such a |
2572 package you'll often wish that the distributed syntax/tex.vim would support | 2587 package you'll often wish that the distributed syntax/tex.vim would support |
2573 it. However, clearly this is impractical. So please consider using the | 2588 it. However, clearly this is impractical. So please consider using the |
2574 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided | 2589 techniques in |mysyntaxfile-add| to extend or modify the highlighting provided |
2575 by syntax/tex.vim. | 2590 by syntax/tex.vim. |
2576 | 2591 |
2577 *tex-error* | 2592 *tex-error* |
2578 Excessive Error Highlighting? ~ | 2593 Excessive Error Highlighting? ~ |
2579 | 2594 |
2580 The <tex.vim> supports lexical error checking of various sorts. Thus, | 2595 The <tex.vim> supports lexical error checking of various sorts. Thus, |
2581 although the error checking is ofttimes very useful, it can indicate | 2596 although the error checking is ofttimes very useful, it can indicate |
2582 errors where none actually are. If this proves to be a problem for you, | 2597 errors where none actually are. If this proves to be a problem for you, |
2583 you may put in your <.vimrc> the following statement: > | 2598 you may put in your <.vimrc> the following statement: > |
2584 let tex_no_error=1 | 2599 let tex_no_error=1 |
2585 and all error checking by <syntax/tex.vim> will be suppressed. | 2600 and all error checking by <syntax/tex.vim> will be suppressed. |
2586 | 2601 |
2587 *tex-math* | 2602 *tex-math* |
2588 Need a new Math Group? ~ | 2603 Need a new Math Group? ~ |
2589 | 2604 |
2590 If you want to include a new math group in your LaTeX, the following | 2605 If you want to include a new math group in your LaTeX, the following |
2591 code shows you an example as to how you might do so: > | 2606 code shows you an example as to how you might do so: > |
2592 call TexNewMathZone(sfx,mathzone,starform) | 2607 call TexNewMathZone(sfx,mathzone,starform) |
2597 You'll need to change "mathzone" to the name of your new math group, | 2612 You'll need to change "mathzone" to the name of your new math group, |
2598 and then to the call to it in .vim/after/syntax/tex.vim. | 2613 and then to the call to it in .vim/after/syntax/tex.vim. |
2599 The "starform" variable, if true, implies that your new math group | 2614 The "starform" variable, if true, implies that your new math group |
2600 has a starred form (ie. eqnarray*). | 2615 has a starred form (ie. eqnarray*). |
2601 | 2616 |
2602 *tex-style* | 2617 *tex-style* |
2603 Starting a New Style? ~ | 2618 Starting a New Style? ~ |
2604 | 2619 |
2605 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in | 2620 One may use "\makeatletter" in *.tex files, thereby making the use of "@" in |
2606 commands available. However, since the *.tex file doesn't have one of the | 2621 commands available. However, since the *.tex file doesn't have one of the |
2607 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag | 2622 following suffices: sty cls clo dtx ltx, the syntax highlighting will flag |
2622 set "tf_minlines" to the value you desire. Example: > | 2637 set "tf_minlines" to the value you desire. Example: > |
2623 | 2638 |
2624 :let tf_minlines = your choice | 2639 :let tf_minlines = your choice |
2625 | 2640 |
2626 | 2641 |
2627 VIM *vim.vim* *ft-vim-syntax* | 2642 VIM *vim.vim* *ft-vim-syntax* |
2628 | 2643 *g:vimsyn_minlines* *g:vimsyn_maxlines* |
2629 There is a tradeoff between more accurate syntax highlighting versus | 2644 There is a tradeoff between more accurate syntax highlighting versus screen |
2630 screen updating speed. To improve accuracy, you may wish to increase | 2645 updating speed. To improve accuracy, you may wish to increase the |
2631 the g:vim_minlines variable. The g:vim_maxlines variable may be used | 2646 g:vimsyn_minlines variable. The g:vimsyn_maxlines variable may be used to |
2632 to improve screen updating rates (see |:syn-sync| for more on this). | 2647 improve screen updating rates (see |:syn-sync| for more on this). > |
2633 | 2648 |
2634 g:vim_minlines : used to set synchronization minlines | 2649 g:vimsyn_minlines : used to set synchronization minlines |
2635 g:vim_maxlines : used to set synchronization maxlines | 2650 g:vimsyn_maxlines : used to set synchronization maxlines |
2636 | 2651 < |
2637 The g:vimembedscript option allows for somewhat faster loading of syntax | 2652 (g:vim_minlines and g:vim_maxlines are deprecated variants of |
2638 highlighting for vim scripts at the expense of supporting syntax highlighting | 2653 these two options) |
2639 for external scripting languages (currently perl, python, ruby, and tcl). | 2654 |
2640 | 2655 *g:vimsyn_embed* |
2641 g:vimembedscript == 1 (default) <vim.vim> will allow highlighting | 2656 The g:vimsyn_embed option allows users to select what, if any, types of |
2642 g:vimembedscript doesn't exist of supported embedded scripting | 2657 embedded script highlighting they wish to have. > |
2643 languages: perl, python, ruby and | 2658 |
2644 tcl. | 2659 g:vimsyn_embed == 0 : don't embed any scripts |
2645 | 2660 g:vimsyn_embed =~ 'm' : embed mzscheme (but only if vim supports it) |
2646 g:vimembedscript == 0 Syntax highlighting for embedded | 2661 g:vimsyn_embed =~ 'p' : embed perl (but only if vim supports it) |
2647 scripting languages will not be | 2662 g:vimsyn_embed =~ 'P' : embed python (but only if vim supports it) |
2648 loaded. | 2663 g:vimsyn_embed =~ 'r' : embed ruby (but only if vim supports it) |
2649 | 2664 g:vimsyn_embed =~ 't' : embed tcl (but only if vim supports it) |
2665 < | |
2666 By default, g:vimsyn_embed is "mpPr"; ie. syntax/vim.vim will support | |
2667 highlighting mzscheme, perl, python, and ruby by default. Vim's has("tcl") | |
2668 test appears to hang vim when tcl is not truly available. Thus, by default, | |
2669 tcl is not supported for embedding (but those of you who like tcl embedded in | |
2670 their vim syntax highlighting can simply include it in the g:vimembedscript | |
2671 option). | |
2672 *g:vimsyn_folding* | |
2673 | |
2674 Some folding is now supported with syntax/vim.vim: > | |
2675 | |
2676 g:vimsyn_folding == 0 or doesn't exist: no syntax-based folding | |
2677 g:vimsyn_folding =~ 'a' : augroups | |
2678 g:vimsyn_folding =~ 'f' : fold functions | |
2679 g:vimsyn_folding =~ 'm' : fold mzscheme script | |
2680 g:vimsyn_folding =~ 'p' : fold perl script | |
2681 g:vimsyn_folding =~ 'P' : fold python script | |
2682 g:vimsyn_folding =~ 'r' : fold ruby script | |
2683 g:vimsyn_folding =~ 't' : fold tcl script | |
2684 | |
2685 *g:vimsyn_noerror* | |
2650 Not all error highlighting that syntax/vim.vim does may be correct; VimL is a | 2686 Not all error highlighting that syntax/vim.vim does may be correct; VimL is a |
2651 difficult language to highlight correctly. A way to suppress error | 2687 difficult language to highlight correctly. A way to suppress error |
2652 highlighting is to put: > | 2688 highlighting is to put the following line in your |vimrc|: > |
2653 | 2689 |
2654 let g:vimsyntax_noerror = 1 | 2690 let g:vimsyn_noerror = 1 |
2655 | 2691 < |
2656 in your |vimrc|. | |
2657 | 2692 |
2658 | 2693 |
2659 XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax* | 2694 XF86CONFIG *xf86conf.vim* *ft-xf86conf-syntax* |
2660 | 2695 |
2661 The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both | 2696 The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both |
3156 line break. | 3191 line break. |
3157 | 3192 |
3158 | 3193 |
3159 fold *:syn-fold* | 3194 fold *:syn-fold* |
3160 | 3195 |
3161 The "fold" argument makes the fold level increased by one for this item. | 3196 The "fold" argument makes the fold level increase by one for this item. |
3162 Example: > | 3197 Example: > |
3163 :syn region myFold start="{" end="}" transparent fold | 3198 :syn region myFold start="{" end="}" transparent fold |
3164 :syn sync fromstart | 3199 :syn sync fromstart |
3165 :set foldmethod=syntax | 3200 :set foldmethod=syntax |
3166 This will make each {} block form one fold. | 3201 This will make each {} block form one fold. |
3318 use another character that is not used in the pattern. Examples: > | 3353 use another character that is not used in the pattern. Examples: > |
3319 :syntax region Comment start="/\*" end="\*/" | 3354 :syntax region Comment start="/\*" end="\*/" |
3320 :syntax region String start=+"+ end=+"+ skip=+\\"+ | 3355 :syntax region String start=+"+ end=+"+ skip=+\\"+ |
3321 | 3356 |
3322 See |pattern| for the explanation of what a pattern is. Syntax patterns are | 3357 See |pattern| for the explanation of what a pattern is. Syntax patterns are |
3323 always interpreted like the 'magic' options is set, no matter what the actual | 3358 always interpreted like the 'magic' option is set, no matter what the actual |
3324 value of 'magic' is. And the patterns are interpreted like the 'l' flag is | 3359 value of 'magic' is. And the patterns are interpreted like the 'l' flag is |
3325 not included in 'cpoptions'. This was done to make syntax files portable and | 3360 not included in 'cpoptions'. This was done to make syntax files portable and |
3326 independent of 'compatible' and 'magic' settings. | 3361 independent of 'compatible' and 'magic' settings. |
3327 | 3362 |
3328 Try to avoid patterns that can match an empty string, such as "[a-z]*". | 3363 Try to avoid patterns that can match an empty string, such as "[a-z]*". |
3377 - There must be no white space between the pattern and the character | 3412 - There must be no white space between the pattern and the character |
3378 offset(s). | 3413 offset(s). |
3379 - The highlighted area will never be outside of the matched text. | 3414 - The highlighted area will never be outside of the matched text. |
3380 - A negative offset for an end pattern may not always work, because the end | 3415 - A negative offset for an end pattern may not always work, because the end |
3381 pattern may be detected when the highlighting should already have stopped. | 3416 pattern may be detected when the highlighting should already have stopped. |
3417 - Until Vim 7.2 the offsets were counted in bytes instead of characters. This | |
3418 didn't work well for multi-byte characters. | |
3382 - The start of a match cannot be in a line other than where the pattern | 3419 - The start of a match cannot be in a line other than where the pattern |
3383 matched. This doesn't work: "a\nb"ms=e. You can make the highlighting | 3420 matched. This doesn't work: "a\nb"ms=e. You can make the highlighting |
3384 start in another line, this does work: "a\nb"hs=e. | 3421 start in another line, this does work: "a\nb"hs=e. |
3385 | 3422 |
3386 Example (match a comment but don't highlight the /* and */): > | 3423 Example (match a comment but don't highlight the /* and */): > |
3498 add={group-name}.. | 3535 add={group-name}.. |
3499 The specified groups are added to the cluster. | 3536 The specified groups are added to the cluster. |
3500 remove={group-name}.. | 3537 remove={group-name}.. |
3501 The specified groups are removed from the cluster. | 3538 The specified groups are removed from the cluster. |
3502 | 3539 |
3503 A cluster so defined may be referred to in a contains=.., nextgroup=.., add=.. | 3540 A cluster so defined may be referred to in a contains=.., containedin=.., |
3504 or remove=.. list with a "@" prefix. You can also use this notation to | 3541 nextgroup=.., add=.. or remove=.. list with a "@" prefix. You can also use |
3505 implicitly declare a cluster before specifying its contents. | 3542 this notation to implicitly declare a cluster before specifying its contents. |
3506 | 3543 |
3507 Example: > | 3544 Example: > |
3508 :syntax match Thing "# [^#]\+ #" contains=@ThingMembers | 3545 :syntax match Thing "# [^#]\+ #" contains=@ThingMembers |
3509 :syntax cluster ThingMembers contains=ThingMember1,ThingMember2 | 3546 :syntax cluster ThingMembers contains=ThingMember1,ThingMember2 |
3510 | 3547 |
4192 | 4229 |
4193 *hl-User1* *hl-User1..9* *hl-User9* | 4230 *hl-User1* *hl-User1..9* *hl-User9* |
4194 The 'statusline' syntax allows the use of 9 different highlights in the | 4231 The 'statusline' syntax allows the use of 9 different highlights in the |
4195 statusline and ruler (via 'rulerformat'). The names are User1 to User9. | 4232 statusline and ruler (via 'rulerformat'). The names are User1 to User9. |
4196 | 4233 |
4197 For the GUI you can use these groups to set the colors for the menu, | 4234 For the GUI you can use the following groups to set the colors for the menu, |
4198 scrollbars and tooltips. They don't have defaults. This doesn't work for the | 4235 scrollbars and tooltips. They don't have defaults. This doesn't work for the |
4199 Win32 GUI. Only three highlight arguments have any effect here: font, guibg, | 4236 Win32 GUI. Only three highlight arguments have any effect here: font, guibg, |
4200 and guifg. | 4237 and guifg. |
4201 | 4238 |
4202 *hl-Menu* | 4239 *hl-Menu* |