home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim54rt.sit / runtime / doc / syntax.txt < prev    next >
Encoding:
Text File  |  1999-08-14  |  85.7 KB  |  2,145 lines  |  [TEXT/ALFA]

  1. *syntax.txt*    For Vim version 5.4.  Last change: 1999 Jul 21
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Syntax highlighting        *syntax* *syntax-highlighting* *coloring*
  8.  
  9. Syntax highlighting enables the possibility to show parts of the text in
  10. another font or color.  Those parts can be specific keywords or text
  11. matching a pattern.  Vim doesn't parse the whole file (to keep it fast), so
  12. the highlighting has its limitations.  Lexical highlighting might be a
  13. better name, but everybody calls it syntax highlighting, so we'll stick with
  14. that.
  15.  
  16. Vim supports syntax highlighting on all terminals.  But since most ordinary
  17. terminals have very limited highlighting possibilities, it works best in the
  18. GUI version, gvim.
  19.  
  20. 1.  Quick start            |:syn-qstart|
  21. 2.  Syntax files        |:syn-files|
  22. 3.  Syntax loading procedure    |syntax-loading|
  23. 4.  Syntax file remarks        |:syn-file-remarks|
  24. 5.  Defining a syntax        |:syn-define|
  25. 6.  :syntax arguments        |:syn-arguments|
  26. 7.  Syntax patterns        |:syn-pattern|
  27. 8.  Syntax clusters        |:syn-cluster|
  28. 9.  Including syntax files    |:syn-include|
  29. 10. Synchronizing        |:syn-sync|
  30. 11. Listing syntax items    |:syntax|
  31. 12. Highlight command        |:highlight|
  32. 13. Linking groups        |:highlight-link|
  33. 14. Cleaning up            |:syn-clear|
  34. 15. Highlighting tags        |tag-highlight|
  35. 16. Color xterms        |xterm-color|
  36.  
  37. {Vi does not have any of these commands}
  38.  
  39. The syntax highlighting is not available when the |+syntax| feature has been
  40. disabled at compile time.
  41.  
  42. ==============================================================================
  43. 1. Quick start                        *:syn-qstart*
  44.  
  45.                             *:syn-on*
  46. For a large number of common languages syntax files have been included.  To
  47. start using them, type this command:
  48. >  :syntax on
  49.  
  50. This will enable automatic syntax highlighting.  The type of highlighting will
  51. be selected using the file name extension, and sometimes using the first line
  52. of the file.
  53.  
  54. Include this command in your .vimrc if you always want syntax highlighting, or
  55. put it in your .gvimrc if you only want it in the GUI.  If you don't want it
  56. for B&W terminals, but you do want it for color terminals, put this in your
  57. .vimrc:
  58. >  if &t_Co > 1
  59. >    syntax on
  60. >  endif
  61.  
  62. What this command actually does, is executing the command
  63. >  source $VIMRUNTIME/syntax/syntax.vim
  64. If the VIM environment variable is not set, Vim will try to find
  65. the path in another way (see |$VIMRUNTIME|).  Normally this will work just
  66. fine.  If it doesn't, try setting the VIM environment variable to the
  67. directory where the Vim stuff is located.  For example, if your syntax files
  68. are in the "/usr/vim/vim50/syntax" directory, set $VIMRUNTIME to
  69. "/usr/vim/vim50".  You must do this in the shell, before starting Vim.
  70.  
  71.                             *:syn-default-override*
  72. You can override the default highlight settings, by issuing ":highlight"
  73. commands after sourcing "syntax.vim".  For example:
  74. >  syntax on
  75. >  highlight Constant gui=NONE guibg=grey95
  76.  
  77. This will change the GUI highlighting for the "Constant" group.  See
  78. |:highlight| about how to specify highlighting attributes.
  79.  
  80. If you are running in the GUI, you can get white text on a black background
  81. with:
  82. >  highlight Normal guibg=Black guifg=White
  83.  
  84. If you have a black background, use these commands to get better colors (see
  85. 'background'):
  86. >  set background=dark
  87. >  syntax on
  88.  
  89. NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>.
  90. The files for Unix end in <NL>.  This means you should use the right type of
  91. file for your system.  Although on MS-DOS and Windows the right format is
  92. automatically selected if the 'fileformats' option is not empty.
  93.  
  94. NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
  95. of 'background' will not be set until the GUI window is opened, which is after
  96. reading the .gvimrc.  This will cause the wrong default highlighting to be
  97. used.  To set the default value of 'background' before switching on
  98. highlighting, include the ":gui" command in the .gvimrc:
  99.  
  100. >  :gui        " open window and set default for 'background'
  101. >  :syntax on    " start highlighting, use 'background' to set colors
  102.  
  103. NOTE: Using ":gui" in the .gvimrc means that "gvim -f" won't start in the
  104. foreground!  Use ":gui -f" then.
  105.  
  106.  
  107. To switch off the syntax highlighting:            *:syn-off*
  108. >  :syntax off
  109. This will completely disable syntax highlighting and remove it immediately for
  110. all buffers.
  111.  
  112. You can toggle the syntax on/off with this command
  113. >  :if exists("syntax_on") | syntax off | else | syntax on | endif
  114.  
  115. To put this into a mapping, you can use:
  116. >  map <F7> :if exists("syntax_on") <Bar> syntax off <Bar> else <Bar> syntax on <Bar> endif <CR>
  117. [using the |<>| notation, type this literally]
  118.  
  119.  
  120. To make syntax highlighting work only in selected buffers:    *:syn-manual*
  121. >   :syntax manual
  122. This will enable the syntax highlighting, but not switch it on automatically
  123. when starting to edit a buffer.  This is because the FileType autocommands are
  124. not used to select a syntax.
  125.  
  126. Now you can still switch on syntax highlighting for a buffer by setting the
  127. 'syntax' option.  For example, to switch on fortran highlighting:
  128. >   :set syntax=fortran
  129. This can also be done with a |modeline|, so that files that include a modeline
  130. that sets the 'syntax' option will be highlighted.  For example, this line can
  131. be used in a Makefile:
  132. >   # vim: syntax=make
  133.  
  134.                             *syntax-printing*
  135. If you want to print your colored text, you will have to convert it to HTML
  136. first, and then print it from a browser.  See |2html.vim|.
  137.  
  138.  
  139. Details
  140. The ":syntax" commands are implemented by sourcing a file.  To see exactly how
  141. this works, look in the file:
  142.     command        file ~
  143.     :syntax on        $VIMRUNTIME/syntax/syntax.vim
  144.     :syntax manual    $VIMRUNTIME/syntax/manual.vim
  145.     :syntax off        $VIMRUNTIME/syntax/nosyntax.vim
  146. Also see |syntax-loading|.
  147.  
  148. ==============================================================================
  149. 2. Syntax files                        *:syn-files*
  150.  
  151. The syntax and highlighting commands for one language are normally stored in
  152. a syntax file.  The name convention is: "{name}.vim".  Where {name} is the
  153. name of the language, or an abbreviation (to fit the name in 8.3 characters,
  154. which is always done, in case the file will be used on a DOS filesystem).
  155. Examples:
  156.     c.vim        perl.vim    java.vim    html.vim
  157.     cpp.vim        sh.vim        csh.vim
  158.  
  159. The syntax file can contain any Ex commands, just like a vimrc file.  But
  160. the idea is that only commands for a specific language are included.  When a
  161. language is a superset of another language, it may include the other one,
  162. for example, the cpp.vim file could include the c.vim file:
  163. >  :so $VIMRUNTIME/syntax/c.vim
  164.  
  165. The .vim files are normally loaded with an autocommand.  For example:
  166. >  :au Syntax c        source $VIMRUNTIME/syntax/c.vim
  167. >  :au Syntax cpp   source $VIMRUNTIME/syntax/cpp.vim
  168. These commands are normally in the file $VIMRUNTIME/syntax/synload.vim.
  169.  
  170.  
  171. MAKING YOUR OWN SYNTAX FILES                *mysyntaxfile*
  172.  
  173. When you create your own syntax files, and you want to have these
  174. automatically used with ":syntax on", do this:
  175.  
  176. 1. Create a file that contains the autocommands to load your syntax files when
  177.    the right file type is detected.  To prevent loading two syntax files (when
  178.    the file type is used twice), first delete other autocommands for the same
  179.    file type.  You can also include ":highlight" commands in this file, which
  180.    override the normal highlighting (because the file is sourced after setting
  181.    the normal highlighting).  Example:
  182. >    au! Syntax dosbatch    so ~/vim/batch.vim
  183. >    au! Syntax mine        so ~/vim/mine.vim
  184. >    highlight Comment gui=bold
  185.    Let's assume you write this file in "~/vim/mysyntax.vim".
  186.  
  187.    Note that when you introduce a new file type, this must first be detected.
  188.    See |myfiletypefile|.
  189.  
  190.                             *mysyntaxfile-file*
  191. 2. In your .vimrc, set the "mysyntaxfile" variable to the file you just
  192.    created.  For example:
  193. >    let mysyntaxfile = "~/vim/mysyntax.vim"
  194.    Put this before ":syntax on"!
  195.  
  196. If you want to use a new file type, see |new-filetype|.
  197.  
  198. Note that "mysyntaxfile" is sourced AFTER defining the default autocommands
  199. for the supplied syntax files, so that you can override these autocommands
  200. with your own.
  201.  
  202.  
  203. NAMING CONVENTIONS
  204.                             *group-name*
  205. To be able to allow each user to pick his favorite set of colors, there need
  206. to be preferred names for highlight groups that are common for many languages.
  207. These are the ones that are suggested to be used:
  208.  
  209.     *Comment    any comment
  210.  
  211.     *Constant    any constant
  212.      String        a string constant: "this is a string"
  213.      Character    a character constant: 'c', '\n'
  214.      Number        a number constant: 234, 0xff
  215.      Boolean    a boolean constant: TRUE, false
  216.      Float        a floating point constant: 2.3e10
  217.  
  218.     *Identifier    any variable name
  219.      Function    function name (also: methods for classes)
  220.  
  221.     *Statement    any statement
  222.      Conditional    if, then, else, endif, switch, etc.
  223.      Repeat        for, do, while, etc.
  224.      Label        case, default, etc.
  225.      Operator    "sizeof", "+", "*", etc.
  226.      Keyword    any other keyword
  227.      Exception    try, catch, throw
  228.  
  229.     *PreProc    generic Preprocessor
  230.      Include    preprocessor #include
  231.      Define        preprocessor #define
  232.      Macro        same as Define
  233.      PreCondit    preprocessor #if, #else, #endif, etc.
  234.  
  235.     *Type        int, long, char, etc.
  236.      StorageClass    static, register, volatile, etc.
  237.      Structure    struct, union, enum, etc.
  238.      Typedef    A typedef
  239.  
  240.     *Special    any special symbol
  241.      SpecialChar    special character in a constant
  242.      Tag        you can use CTRL-] on this
  243.      Delimiter    character that needs attention
  244.      SpecialComment    special things inside a comment
  245.      Debug        debugging statements
  246.  
  247.     *Ignore        left blank, hidden
  248.  
  249.     *Error        any erroneous construct
  250.  
  251.     *Todo        anything that needs extra attention; mostly the
  252.             keywords TODO FIXME and XXX
  253.  
  254. The ones marked with * are the preferred groups, the other are minor groups.
  255. For the preferred groups, the "syntax.vim" file contains default highlighting.
  256. The minor groups are linked to the preferred groups, so they get the same
  257. highlighting.  You can override these defaults by giving ":highlight" commands
  258. after sourcing the "syntax.vim" file.
  259.  
  260. Note that highlight group names are not case sensitive.  "String" and "string"
  261. can be used for the same group.
  262.  
  263. The following names are reserved and cannot be used as a group name:
  264.     NONE   ALL   ALLBUT   contains   contained
  265.  
  266. ==============================================================================
  267. 3. Syntax loading procedure                *syntax-loading*
  268.  
  269. This explains the details that happen when the command ":syntax on" is issued.
  270. When Vim initializes itself, it finds out where the runtime files are located.
  271. This is used here as the variable |$VIMRUNTIME|.
  272.  
  273. What ":syntax on" does:
  274.  
  275.     Source $VIMRUNTIME/syntax/syntax.vim
  276.     |
  277.     +-    Clear out any old syntax.
  278.     |
  279.     +-    Source $VIMRUNTIME/syntax/synload.vim
  280.     |    |
  281.     |    +-  Set up standard highlighting groups
  282.     |    |
  283.     |    +-  Set up syntax autocmds to load the appropriate syntax file when
  284.     |    |   the 'syntax' option is set. *synload-1*
  285.     |    |
  286.     |    +-  Source the user's optional file, from the |mysyntaxfile| variable.
  287.     |        This is where you can add your own syntax autocommands for loading
  288.     |        your syntax file when the 'syntax' option is set.  You can also
  289.     |        modify the standard highlighting here. *synload-2*
  290.     |
  291.     +-    Source $VIMRUNTIME/filetype.vim
  292.     |    |
  293.     |    +-  Install autocmds based on suffix to set the 'filetype' option
  294.     |    |   This is where the connection between file name and file type is
  295.     |    |   made for known file types. *synload-3*
  296.     |    |
  297.     |    +-  Source the user's optional file, from the |myfiletypefile|
  298.     |    |   variable.  This is where you can add your own connections between
  299.     |    |   file name and file type.  Or overrule existing ones. *synload-4*
  300.     |    |
  301.     |    +-  Install one autocommand which loads $VIMRUNTIME/scripts.vim when
  302.     |    |   no file type was detected yet. *synload-5*
  303.     |    |
  304.     |    +-  Source $VIMRUNTIME/menu.vim, to setup the Syntax menu. |menu.vim|
  305.     |
  306.     +-    Install a FileType autocommand to set the 'syntax' option when a file
  307.     |    type has been detected. *synload-6*
  308.     |
  309.     +-    Execute syntax autocommands to start syntax highlighting for each
  310.     already loaded buffer.
  311.  
  312.  
  313. When a file is loaded, its syntax file is found in this way:
  314.  
  315.     Loading the file triggers the BufReadPost autocommands.
  316.     |
  317.     +-    If there is a match with one of the autocommands from |synload-3|
  318.     |    (known file types) or |synload-4| (user's file types), the 'filetype'
  319.     |    option is set to the file type.
  320.     |
  321.     +-    The autocommand at |synload-5| is triggered.  If the file type was not
  322.     |    found yet, then $VIMRUNTIME/scripts.vim is sourced.
  323.     |    |
  324.     |    +-  Source the user's optional |myscriptsfile|.  This typically makes
  325.     |    |   checks using "getline(1) =~ pattern" to find out which file type
  326.     |    |   the file is, and sets 'filetype'.
  327.     |    |
  328.     |    +-  If the file type is still unknown, check the contents of the file,
  329.     |        again with checks like "getline(1) =~ pattern" as to whether the
  330.     |        file type can be recognized, and set 'filetype'.
  331.     |
  332.     +-    When the file type was determined and 'filetype' was set, this
  333.     |    triggers the FileType autocommand |synload-6| above.  It sets
  334.     |    'syntax' to the determined file type.
  335.     |
  336.     +-    When the 'syntax' option was set above, this triggers an autocommand
  337.     |    from |synload-1| or |synload-2|.  This will source the syntax file in
  338.     |    the $VIMRUNTIME/syntax directory or the user's syntax file.
  339.     |
  340.     +-    Any other user installed FileType or Syntax autocommands are
  341.     triggered.  This can be used to change the highlighting for a specific
  342.     syntax.
  343.  
  344. ==============================================================================
  345. 4. Syntax file remarks                    *:syn-file-remarks*
  346.  
  347.                         *b:current_syntax-variable*
  348. The name of the syntax that has been loaded is stored in the
  349. "b:current_syntax" variable.  You can use this if you want to load other
  350. settings, depending on which syntax is active.  Example:
  351. >  :au BufReadPost * if b:current_syntax == "csh"
  352. >  :au BufReadPost *   do-some-things
  353. >  :au BufReadPost * endif
  354.  
  355.  
  356. 2HTML                        *2html.vim* *convert-to-HTML*
  357.  
  358. This is not a syntax file itself, but a script that converts the current
  359. window into HTML.  A new window is opened, in which the HTML file is built.
  360.     Warning: This is slow!
  361. The resulting file can be written where you want it.  You can then view it
  362. with any HTML viewer, such as Netscape.  The colors should be exactly the same
  363. as you see them in Vim.
  364. Remarks:
  365. - This only works in a version with GUI support.  If the GUI not actually
  366.   running (possible for X11) it still works, but not that good (the color
  367.   names may be wrong).
  368. - In older browsers the background colors will not be shown.
  369. - From Netscape you can also print the file (in color)!
  370. - When 'tabstop' is not 8, the amount of white space will be wrong.
  371.  
  372. Here is an example how to run the script over all .c and .h files from a
  373. Unix shell:
  374. >  $ for f in *.[ch]; do gvim -f +"syn on" +"so \$VIMRUNTIME/syntax/2html.vim" +"wq" +"q" $f; done
  375.  
  376.  
  377. Assembly                *asm.vim* *asmh8300.vim* *nasm.vim*
  378.  
  379. There are many types of assembly languages that all use the same file name
  380. extensions.  Therefore you will have to select the type yourself, or add a
  381. line in the assembly file that Vim will recognize.
  382.  
  383. The most flexible is to add a line in your assembly file containing:
  384. >    asmsyntax=nasm
  385. Replace "nasm" with the name of the real assembly syntax.  This line must be
  386. one of the first five lines in the file.
  387.  
  388. The syntax type can always be overruled for a specific buffer by setting the
  389. b:asmsyntax variable:
  390. >    let b:asmsyntax=nasm
  391.  
  392. If b:asmsyntax is not set, either automatically or by hand, then the value of
  393. the global variable asmsyntax is used.  This can be seen as a default assembly
  394. language:
  395. >    let asmsyntax=nasm
  396.  
  397. As a last resort, if nothing is defined, the "asm" syntax is used.
  398.  
  399.  
  400.                             *basic.vim* *vb.vim*
  401. Both Visual Basic and "normal" basic use the extension ".bas".  To detect
  402. which one should be used, Vim checks for the string "VB_Name" in the first
  403. five lines of the file.  If it is not found, filetype will be "basic",
  404. otherwise "vb".  Files with the ".frm" extension will always be seen as Visual
  405. Basic.
  406.  
  407.  
  408. C                            *c.vim*
  409.  
  410. A few things in C highlighting are optional.  To enable them assign any value
  411. to the respective value.  Example:
  412. >  let c_comment_strings=1
  413. To disable them use ":unlet".  Example:
  414. >  unlet c_comment_strings
  415.  
  416. variable        Highlight ~
  417. c_comment_strings    strings and numbers inside a comment
  418. c_space_errors        trailing white space and spaces before a <Tab>
  419. c_no_trail_space_error     ... but no trailing spaces
  420. c_no_tab_space_error     ... but no spaces before a <Tab>
  421. c_no_ansi        don't do standard ANSI types and constants
  422. c_ansi_typedefs         ... but do standard ANSI types
  423. c_ansi_constants     ... but do standard ANSI constants
  424. c_no_utf        don't highlight \u and \U in strings
  425. c_syntax_for_h        use C syntax for *.h files, instead of C++
  426. c_no_if0        don't highlight "#if 0" blocks as comments
  427. c_no_cformat        don't highlight %-formats in strings
  428.  
  429. If you notice highlighting errors while scrolling backwards, which are fixed
  430. when redrawing with CTRL-L, try setting the "c_minlines" internal variable
  431. to a larger number:
  432. >  let c_minlines = 100
  433. This will make the syntax synchronization start 100 lines before the first
  434. displayed line.  The default value is 50 (15 when c_no_if0 is set).  The
  435. disadvantage of using a larger number is that redrawing can become slow.
  436.  
  437. When using the "#if 0" / "#endif" comment highlighting, notice that this only
  438. works when the "#if 0" is within "c_minlines" from the top of the window.  If
  439. you have a long "#if 0" construct it will not be highlighted correctly.
  440.  
  441. To match extra items in comments the cCommentGroup cluster can be used.
  442. Example:
  443. >   au Syntax c call MyCadd()
  444. >   function MyCadd()
  445. >     syn keyword cMyItem contained Ni
  446. >     syn cluster cCommentGroup add=cMyItem
  447. >     hi link cMyItem Title
  448. >   endfun
  449.  
  450. ANSI constants will be highlighted with the "cConstant" group.  This includes
  451. "NULL", "SIG_IGN" and others.  But not "TRUE", for example, because this is
  452. not in the ANSI standard.  If you find this confusing, remove the cConstant
  453. highlighting:
  454. >   :hi link cConstant NONE
  455.  
  456.  
  457. COBOL                            *cobol.vim*
  458.  
  459. COBOL highlighting for legacy code has different needs than fresh development.
  460. This is due both to differences in what is being done (maintenance versus
  461. development) as well as other factors.  To enable legacy code highlighting,
  462. add this line to you .vimrc:
  463. >  let cobol_legacy_code=1
  464. To disable it again, use this:
  465. >  unlet cobol_legacy_code
  466.  
  467.  
  468. EIFFEL                            *eiffel.vim*
  469.  
  470. While Eiffel is not case-sensitive, its style guidelines are, and the
  471. syntax highlighting file encourages their use. This also allows to
  472. highlight class names differently. If you want to disable case-sensitive
  473. highlighting, add the following line to your startup file:
  474.  
  475. >  let eiffel_ignore_case=1
  476.  
  477. Case still matters for class names and TODO marks in comments.
  478.  
  479. Conversely, for even stricter checks, add the following line too:
  480.  
  481. >  let eiffel_pedantic=1
  482.  
  483. Currently, this will only catch improper capitalization for the five
  484. predefined words "Current", "Void", "Result", "Precursor", and "NONE",
  485. to warn against their accidental use as feature or class names.
  486.  
  487. If instead you want to use the lower-case version of "Current", "Void",
  488. "Result", and "Precursor", you can use
  489.  
  490. >  let eiffel_lower_case_predef=1
  491.  
  492. instead of completely turning case-sensitive highlighting off.
  493.  
  494. Finally, some vendors support hexadecimal constants. To handle them, add
  495.  
  496. >  let eiffel_hex_constants=1
  497.  
  498. to your startup file.
  499.  
  500.  
  501. FVWM CONFIGURATION FILES                *fvwm.vim*
  502.  
  503. To make Vim highlight all valid color names, let "rgb_file" contain the
  504. full path of the color database (rgb.txt).  E.g.,
  505.  
  506. >  let rgb_file = "/usr/X11/lib/X11/rgb.txt"
  507.  
  508.  
  509. HTML                            *html.vim*
  510.  
  511. The coloring scheme for tags in the HTML file works as follows.
  512.  
  513. The  <> of opening tags are colored differently than the </> of a closing tag.
  514. This is on purpose! For opening tags the 'Function' color is used, while for
  515. closing tags the 'Type' color is used (See syntax.vim to check how those are
  516. defined for you)
  517.  
  518. Known tag names are colored the same way as statements in C.  Unknown tag
  519. names are colored with the same color as the <> or </> respectively which
  520. makes it easy to spot errors
  521.  
  522. Note that the same is true for argument (or attribute) names. Known attribute
  523. names are colored differently than unknown ones.
  524.  
  525. Some HTML tags are used to change the rendering of text. The following tags
  526. are recognized by the html.vim syntax coloring file and change the way normal
  527. text is shown: <B> <I> <U> <EM> <STRONG> (<EM> is used as an alias for <I>,
  528. while <STRONG> as an alias for <B>), <H1> - <H6>, <HEAD>, <TITLE> and <A>, but
  529. only if used as a link that is, it must include a href as in
  530. <A href="somfile.html">).
  531.  
  532. If you want to change how such text is rendered, you must redefine the
  533. following syntax groups:
  534.  
  535.     - htmlBold
  536.     - htmlBoldUnderline
  537.     - htmlBoldUnderlineItalic
  538.     - htmlUnderline
  539.     - htmlUnderlineItalic
  540.     - htmlItalic
  541.     - htmlLink for links
  542.     - htmlTitle for titles
  543.     - htmlH1 - htmlH6 for headings
  544.  
  545. To make this redefinition work you must redefine them all with the exception
  546. of the last two (htmlTitle and htmlH[1-6], which are optional) and define the
  547. following variable in your vimrc (this is due to the order in which the files
  548. are read during initialization)
  549. >   let html_my_rendering=1
  550.  
  551. If you'd like to see an example download mysyntax.vim at
  552. http://www.fleiner.com/vim/mysyntax.vim
  553.  
  554. You can also disable this rendering by adding the following line to your
  555. vimrc file:
  556. >   let html_no_rendering=1
  557.  
  558. HTML comments are rather special (see an HTML reference document for the
  559. details), and the syntax coloring scheme will highlight all errors.
  560. However, if you prefer to use the wrong style (starts with <!-- and
  561. ends with -->) you can define
  562. >   let html_wrong_comments=1
  563.  
  564. JavaScript and Visual Basic embedded inside HTML documents are highlighted as
  565. 'Special' with statements, comments, strings and so on colored as in standard
  566. programming languages. Note that only JavaScript and Visual Basic are currently
  567. supported, no other scripting language has been added yet.
  568.  
  569. Embedded and inlined cascading style sheets (CSS) are highlighted too.
  570.  
  571. There are several html preprocessor languages out there. html.vim has been
  572. written such that it should be trivial to include it. To do so add the
  573. following two lines to the syntax coloring file for that language
  574. (the example comes from the asp.vim file):
  575.  
  576.     source <sfile>:p:h/html.vim
  577.     syn cluster htmlPreproc add=asp
  578.  
  579. Now you just need to make sure that you add all regions that contain
  580. the preprocessor language to the cluster htmlPreproc.
  581.  
  582.  
  583. JAVA                            *java.vim*
  584.  
  585. The java.vim syntax highlighting file offers several options:
  586.  
  587. In Java 1.0.2 it was never possible to have braces inside parens, so this was
  588. flagged as an error.  Since Java 1.1 this is possible (with anonymous
  589. classes), and therefore is no longer marked as an error. If you prefer the old
  590. way, put the following line into your vim startup file:
  591. >  let java_mark_braces_in_parens_as_errors=1
  592.  
  593. Function names are not highlighted, as the way to find functions depends on
  594. how you write java code.  The syntax file knows two possible ways to highlight
  595. functions:
  596.  
  597. If you write function declarations that are always indented by either
  598. a tab, 8 spaces or 2 spaces you may want to set
  599. >  let java_highlight_functions="indent"
  600. However, if you follow the java guidlines about how functions and classes are
  601. supposed to be named (with respect to upper and lower cases), use
  602. >  let java_highlight_functions="style"
  603. If both options do not work for you, but you would still want function
  604. declarations to be highlighted create your own definitions by changing the
  605. definitions in java.vim or by creating your own java.vim which includes the
  606. original one and then adds the code to highlight functions.
  607.  
  608. In java 1.1 the functions System.out.println() and System.err.println() should
  609. only be used for debugging. Therefor it is possible to highlight debugging
  610. statements differently. To do this you must add the following definition in
  611. your startup file:
  612. >  let java_highlight_debug=1
  613. The result will be that those statements are highlighted as 'Special'
  614. characters. If you prefer to have them highlighted differently you must define
  615. new highlightings for the following groups.:
  616.     Debug, DebugSpecial, DebugString, DebugBoolean, DebugType
  617. which are used for the statement itself, special characters used in debug
  618. strings, strings, boolean constants and types (this, super) respectively. I
  619. have opted to chose another background for those statements.
  620.  
  621. In order to help you to write code that can be easely ported between
  622. java and C++, all C++ keywords are marked as error in a java program.
  623. However, if you use them regularly, you may want to define the following
  624. variable in your .vimrc file:
  625. >  let java_allow_cpp_keywords=1
  626.  
  627. Javadoc is a program that takes special comments out of java program files and
  628. creates HTML pages. The standard configuration will highlight this HTML code
  629. similarly to HTML files (see |html.vim|). You can even add javascript
  630. and CSS inside this code (see below). There are four differences however:
  631.   1. The title (all characters up to the first '.' which is followed by
  632.      some white space or up to the first '@') is colored differently (to change
  633.      the color change the group CommentTitle).
  634.   2. The text is colored as 'Comment'.
  635.   3. HTML comments are colored as 'Special'
  636.   4. The special javadoc tags (@see, @param, ...) are highlighted as specials
  637.      and the argument (for @see, @param, @exception) as Function.
  638. To turn this feature off add the following line to your startup file:
  639. >  let java_ignore_javadoc=1
  640.  
  641. If you use the special javadoc comment highlighting described above you
  642. can also turn on special highlighting for javascript, visual basic
  643. scripts and embedded CSS (stylesheets). This makes only sense if you
  644. actually have javadoc comments that include either javascript or embedded
  645. CSS. The options to use are
  646. >  let java_javascript=1
  647. >  let java_css=1
  648. >  let java_vb=1
  649.  
  650. If you notice highlighting errors while scrolling backwards, which are fixed
  651. when redrawing with CTRL-L, try setting the "java_minlines" internal variable
  652. to a larger number:
  653. >  let java_minlines = 50
  654. This will make the syntax synchronization start 50 lines before the first
  655. displayed line.  The default value is 10.  The disadvantage of using a larger
  656. number is that redrawing can become slow.
  657.  
  658.  
  659. LACE                            *lace.vim*
  660.  
  661. Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the
  662. style guide lines are not.  If you prefer case insensitive highlighting, just
  663. define the vim variable 'lace_case_insensitive' in your startup file:
  664. >  let lace_case_insensitive=1
  665.  
  666.  
  667. LEX                            *lex.vim*
  668.  
  669. Lex uses brute-force synchronizing as the "^%%$" section delimiter
  670. gives no clue as to what section follows.  Consequently, the value for
  671. >syn sync minlines=300
  672. may be changed by the user if s/he is experiencing synchronization
  673. difficulties (such as may happen with large lex files).
  674.  
  675.  
  676. MAPLE                            *maple.vim*
  677.  
  678. Maple V, by Waterloo Maple Inc, supports symbolic algebra.  The language
  679. supports many packages of functions which are selectively loaded by the user.
  680. The standard set of packages' functions as supplied in Maple V release 4 may be
  681. highlighted at the user's discretion.  Users may place in their .vimrc file:
  682.  
  683. >  let mvpkg_all= 1
  684.  
  685. to get all package functions highlighted, or users may select any subset by
  686. choosing a variable/package from the table below and setting that variable to
  687. 1, also in their .vimrc file (prior to sourcing
  688. $VIMRUNTIME/syntax/syntax.vim).
  689.  
  690.     Table of Maple V Package Function Selectors ~
  691. >  mv_DEtools     mv_genfunc    mv_networks    mv_process
  692. >  mv_Galois     mv_geometry    mv_numapprox    mv_simplex
  693. >  mv_GaussInt     mv_grobner    mv_numtheory    mv_stats
  694. >  mv_LREtools     mv_group    mv_orthopoly    mv_student
  695. >  mv_combinat     mv_inttrans    mv_padic    mv_sumtools
  696. >  mv_combstruct mv_liesymm    mv_plots    mv_tensor
  697. >  mv_difforms     mv_linalg    mv_plottools    mv_totorder
  698. >  mv_finance     mv_logic    mv_powseries
  699.  
  700.  
  701. PERL                                                    *perl.vim*
  702.  
  703. There are a number of possible options to the perl syntax highlighting.
  704.  
  705. If you use POD files or POD segments, you might:
  706.  
  707. > let perl_include_POD = 1
  708.  
  709. To handle package references in variable and function names differently from
  710. the rest of the name (like 'PkgName::' in '$PkgName::VarName'):
  711.  
  712. > let perl_want_scope_in_variables = 1
  713.  
  714. If you want complex things like '@{${"foo"}}' to be parsed:
  715.  
  716. > let perl_extended_vars = 1
  717.  
  718. The coloring strings can be changed. By default strings and qq friends will be
  719. highlighted like the first line. If you set the variable
  720. perl_string_as_statement, it will be highlighted as in the second line.
  721.  
  722.    "hello world!"; qq|hello world|;
  723.    ^^^^^^^^^^^^^^NN^^^^^^^^^^^^^^^N       (unlet perl_string_as_statement)
  724.    S^^^^^^^^^^^^SNNSSS^^^^^^^^^^^^N       (let perl_string_as_statement)
  725.  
  726. (^ = perlString, S = perlStatement, N = None at all)
  727.  
  728. The syncing has 3 options. The first two switch off some triggering of
  729. synchronization and should only be needed in case it fails to work properly.
  730. If while scrolling all of a sudden the whole screen changes color completely
  731. then you should try and switch off one of those. Let me know if you can figure
  732. out the line that causes the mistake.
  733.  
  734. One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less.
  735.  
  736. > let perl_no_sync_on_sub
  737. > let perl_no_sync_on_global_var
  738.  
  739. Below you can set the maximum distance VIM should look for starting points for
  740. its attempts in syntax highlighting.
  741.  
  742. > let perl_sync_dist = 100
  743.  
  744.  
  745. POSTSCRIPT                        *postscr.vim*
  746.  
  747. There are several options when it comes to highlighting PostScript.
  748.  
  749. First which version of the PostScript language to highlight.  There are
  750. currently three defined language versions, or levels.  Level 1 is the original
  751. and base version, and includes all extensions prior to the release of level 2.
  752. Level 2 is the most common version around, and includes its own set of
  753. extensions prior to the release of level 3.  Level 3 is currently the highest
  754. level supported.  You select which level of the PostScript language you want
  755. highlighted by defining the postscr_level variable as follows:
  756.  
  757. >  let postscr_level=2
  758.  
  759. If this variable is not defined it defaults to 2 (level 2) since this is
  760. the most prevalent version currently.
  761.  
  762. Note, not all PS interpreters will support all language features for a
  763. particular language level.  In particular the %!PS-Adobe-3.0 at the start of
  764. PS files does NOT mean the PostScript present is level 3 PostScript!
  765.  
  766. If you are working with Display PostScript, you can include highlighting of
  767. Display PS language features by defining the postscr_display variable as
  768. follows:
  769.  
  770. >  let postscr_display=1
  771.  
  772. If you are working with Ghostscript, you can include highlighting of
  773. Ghostscript specific language features by defining the variable
  774. postscr_ghostscript as follows:
  775.  
  776. >  let postscr_ghostscript=1
  777.  
  778. PostScript is a large language, with many predefined elements.  While it
  779. useful to have all these elements highlighted, on slower machines this can
  780. cause Vim to slow down.  In an attempt to be machine friendly font names and
  781. character encodings are not highlighted by default.  Unless you are working
  782. explicitly with either of these this should be ok.  If you want them to be
  783. highlighted you should set one or both of the following variables:
  784.  
  785. >  let postscr_fonts=1
  786. >  let postscr_encodings=1
  787.  
  788. There is a stylistic option to the highlighting of and, or, and not.  In
  789. PostScript the function of these operators depends on the types of their
  790. operands - if the operands are booleans then they are the logical operators,
  791. if they are integers then they are binary operators.  As binary and logical
  792. operators can be highlighted differently they have to be highlighted one way
  793. or the other.  By default they are treated as logical operators.  They can be
  794. highlighted as binary operators by defining the variable
  795. postscr_andornot_binary as follows:
  796.  
  797. >  let postscr_andornot_binary=1
  798.  
  799.  
  800. PRINTCAP + TERMCAP        *ptcap.vim* *termcap-syntax* *printcap*
  801.  
  802. This syntax file applies to the printcap and termcap databases.
  803.  
  804. If you notice highlighting errors while scrolling backwards, which
  805. are fixed when redrawing with CTRL-L, try setting the "ptcap_minlines"
  806. internal variable to a larger number:
  807.  
  808. >  let ptcap_minlines = 50
  809.  
  810. (The default is 20 lines.)
  811.  
  812.  
  813. REXX                            *rexx.vim*
  814.  
  815. If you notice highlighting errors while scrolling backwards, which are fixed
  816. when redrawing with CTRL-L, try setting the "rexx_minlines" internal variable
  817. to a larger number:
  818. >  let rexx_minlines = 50
  819. This will make the syntax synchronization start 50 lines before the first
  820. displayed line.  The default value is 10.  The disadvantage of using a larger
  821. number is that redrawing can become slow.
  822.  
  823.  
  824. SED                            *sed.vim*
  825.  
  826. To make tabs stand out from regular blanks (accomplished by using Todo
  827. highlighting on the tabs), define "highlight_sedtabs" by putting
  828.  
  829. >  let highlight_sedtabs = 1
  830.  
  831. in the vimrc file.  (This special highlighting only applies for tabs
  832. inside search patterns, replacement texts, addresses or text included
  833. by an Append/Change/Insert command.)  If you enable this option, it is
  834. also a good idea to set the tab width to one character; by doing that,
  835. you can easily count the number of tabs in a string.
  836.  
  837. Bugs:
  838.  
  839.   The transform command (y) is treated exactly like the substitute
  840.   command.  This means that, as far as this syntax file is concerned,
  841.   transform accepts the same flags as substitute, which is wrong.
  842.   (Transform accepts no flags.)  I tolerate this bug because the
  843.   involved commands need very complex treatment (95 patterns, one for
  844.   each plausible pattern delimiter).
  845.  
  846.  
  847. SH                            *sh.vim*
  848.  
  849. This covers the "normal" Unix sh, bash and the korn shell.  If you're working
  850. on a system where bash is called sh, you will benefit to define the vim
  851. variable 'bash_is_sh' in your '.vimrc' file:
  852. >  let bash_is_sh = 1
  853.  
  854. To choose between the two ways to treat single-quotes inside a pair of
  855. double-quotes, I have introduced a Vim variable "highlight_balanced_quotes".
  856. By default (ie by not declaring this variable) single quotes can be used
  857. inside double quotes, and are not highlighted.  If you prefer balanced single
  858. quotes as I do you just make the statement in your .vimrc file:
  859. >  let highlight_balanced_quotes = 1
  860.  
  861. Similar I have introduced another vim variable "highlight_function_name" to be
  862. used to enable/disable highlighting of the function-name in function
  863. declaration.  Default is not to highlight the function name.  If you want to
  864. highlight functions names, include this in your .vimrc file:
  865. >  let highlight_function_name = 1
  866.  
  867. If you notice highlighting errors while scrolling backwards, which are fixed
  868. when redrawing with CTRL-L, try setting the "sh_minlines" internal variable
  869. to a larger number:
  870. >  let sh_minlines = 200
  871. This will make the syntax synchronization start 200 lines before the first
  872. displayed line.  The default value is 100.  The disadvantage of using a larger
  873. number is that redrawing can become slow.
  874.  
  875. If you don't have much to synchronize on, displaying can be very slow.  To
  876. reduce this, the "sh_maxlines" internal variable can be set:
  877. >  let sh_maxlines = 100
  878. The default is to use the double of "sh_minlines".  Set it to a smaller number
  879. to speed up displaying.  The disadvantage is that highlight errors may appear.
  880.  
  881.  
  882. SPEEDUP (AspenTech plant simulator)                *spup.vim*
  883.  
  884. The Speedup syntax file has some options:
  885.  
  886. - strict_subsections : If this variable is defined, only keywords for
  887.   sections and subsections will be highlighted as statements but not
  888.   other keywords (like WITHIN in the OPERATION section).
  889.  
  890. - highlight_types : Definition of this variable causes stream types
  891.   like temperature or pressure to be highlighted as Type, not as a
  892.   plain Identifier. Included are the types that are usually found in
  893.   the DECLARE section; if you defined own types, you have to include
  894.   them in the syntax file.
  895.  
  896. - oneline_comments : this value ranges from 1 to 3 and determines the
  897.   highlighting of # style comments.
  898.   oneline_comments = 1 : allow normal Speedup code after an even
  899.   number of #s.
  900.   oneline_comments = 2 : show code starting with the second # as
  901.   error. This is the default setting.
  902.   oneline_comments = 3 : show the whole line as error if it contains
  903.   more than one #.
  904.  
  905. Since especially OPERATION sections tend to become very large due to
  906. PRESETting variables, syncing may be critical. If your computer is
  907. fast enough, you can increase minlines and/or maxlines near the end of
  908. the syntax file.
  909.  
  910.  
  911. TEX                            *tex.vim*
  912.  
  913. The tex highlighting supports TeX, LaTeX, and some AmsTeX.  The
  914. highlighting supports three primary zones: normal, texZone, and texMathZone.
  915. Although a considerable effort has been made to have these zones terminate
  916. properly, zones delineated by $..$ and $$..$$ cannot be synchronized as
  917. there's no difference between start and end patterns.  Consequently, a
  918. special "TeX comment" has been provided
  919. > %stopzone
  920. which will forcibly terminate the highlighting of either a texZone or a
  921. texMathZone.
  922.  
  923. If you have a slow computer, you may wish to reduce the values for
  924. > syn sync maxlines=200
  925. > syn sync minlines=50
  926. (especially the latter).  If your computer is fast, you may wish to
  927. increase them.  This primarily affects synchronizing (ie. just what group,
  928. if any, is the text at the top of the screen supposed to be in?).
  929.  
  930.  
  931. X Pixmaps (XPM)                        *xpm.vim*
  932.  
  933. xpm.vim creates its syntax items dynamically based upon the contents of the
  934. XPM file.  Thus if you make changes e.g. in the color specification strings,
  935. you have to source it again e.g. with ":set syn=xpm".
  936.  
  937. To copy a pixel with one of the colors, yank a "pixel" with "yl" and insert it
  938. somewhere else with "P".
  939.  
  940. Do you want to draw with the mouse?  Try the following:
  941. >   function! GetPixel()
  942. >      let c = getline(line("."))[col(".") - 1]
  943. >      echo c
  944. >      exe "noremap <LeftMouse> <LeftMouse>r".c
  945. >      exe "noremap <LeftDrag>  <LeftMouse>r".c
  946. >   endfunction
  947. >   noremap <RightMouse> <LeftMouse>:call GetPixel()<CR>
  948. >   set guicursor=n:hor20          " to see the color beneath the cursor
  949. This turns the right button into a pipette and the left button into a pen.
  950. It will work with XPM files that have one character per pixel only and you
  951. must not click outside of the pixel strings, but feel free to improve it.
  952.  
  953. It will look much better with a font in a quadratic cell size, e.g. for X:
  954. >   set guifont=-*-clean-medium-r-*-*-8-*-*-*-*-80-*
  955.  
  956. ==============================================================================
  957. 5. Defining a syntax                    *:syn-define*
  958.  
  959. Vim understands three types of syntax items:
  960. 1. A keyword.  It can only contain keyword characters, according to the
  961.    'iskeyword' option.  It cannot contain other syntax items.  It will only
  962.    be recognized when it is a complete match (there are no keyword
  963.    characters before or after the match).  "if" would match in "if(a=b)",
  964.    but not in "ifdef x".
  965. 2. A match.  This is a match with a single regexp pattern.  It must be within
  966.    one line.
  967. 3. A region.  This starts at a match of the start regexp pattern and
  968.    ends with a match with the end regexp pattern.  A skip regexp pattern can
  969.    be used to avoid matching the end pattern.
  970.  
  971. Several syntax ITEMs can be put into one syntax GROUP.  For a syntax group
  972. you can give highlighting attributes.  For example, you could have an item
  973. to define a "/* .. */" comment and another one that defines a "// .." comment,
  974. and put them both in the "Comment" group.  You can then specify that a
  975. "Comment" will be in bold font and have a blue color.  You are free to make
  976. one highlight group for one syntax item, or put all items into one group.
  977. This depends on how you want to specify your highlighting attributes.  Putting
  978. each item in its own group results in having to specify the highlighting
  979. for a lot of groups.
  980.  
  981. Note that a syntax group and a highlight group are similar.  For a highlight
  982. group you will have given highlight attributes.  These attributes will be used
  983. for the syntax group with the same name.
  984.  
  985. In case more than one item matches at the same position, the one that was
  986. defined LAST wins.  Thus you can override previously defined syntax items by
  987. using an item that matches the same text.  But a keyword always goes before a
  988. match or region.  And a keyword with matching case always goes before a
  989. keyword with ignoring case.
  990.  
  991.  
  992. DEFINING CASE                        *:syn-case*
  993.  
  994. :sy[ntax] case [match|ignore]
  995.     This defines if the following ":syntax" commands will work with
  996.     matching case, when using "match", or with ignoring case, when using
  997.     "ignore".  Note that any items before this are not affected, and all
  998.     items until the next ":syntax case" command are affected.
  999.  
  1000.  
  1001. DEFINING KEYWORDS                    *:syn-keyword*
  1002.  
  1003. :sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}]
  1004.  
  1005.     This defines a number of keywords.
  1006.  
  1007.     {group-name}    Is a syntax group name such as "Comment".
  1008.     [{options}]    See |:syn-arguments| below.
  1009.     {keyword} ..    Is a list of keywords which are part of this group.
  1010.  
  1011.     Example:
  1012. >  :syntax keyword   Type   int long char
  1013.  
  1014.     The {options} can be given anywhere in the line.  They will apply to
  1015.     all keywords given, also for options that come after a keyword.
  1016.     These examples do exactly the same:
  1017. >  :syntax keyword   Type   contained int long char
  1018. >  :syntax keyword   Type   int long contained char
  1019. >  :syntax keyword   Type   int long char contained
  1020.  
  1021.     When you have a keyword with an optional tail, like Ex commands in
  1022.     Vim, you can put the optional characters inside [], to define all the
  1023.     variations at once:
  1024. >  :syntax keyword   VimCommand   ab[breviate] n[ext]
  1025.  
  1026.     A keyword always has higher priority than a match or region, the
  1027.     keyword is used if more than one item matches.  Keywords do not nest
  1028.     and a keyword can't contain anything else.
  1029.  
  1030.     Note that when you have a keyword that is the same as an option (even
  1031.     one that isn't allowed here), you can not use it.  Use a match
  1032.     instead.
  1033.  
  1034.     The maximum length of a keyword is 80 characters.
  1035.  
  1036.     The same keyword can be defined multiple times, when its containment
  1037.     differs.  For example, you can define the keyword once not contained
  1038.     and use one highlight group, and once contained, and use a different
  1039.     highlight group. Example:
  1040. >  :syn keyword vimCommand tag
  1041. >  :syn keyword vimSetting contained tag
  1042.     When finding "tag" outside of any syntax item, the "vimCommand"
  1043.     highlight group is used.  When finding "tag" in a syntax item that
  1044.     contains "vimSetting", the "vimSetting" group is used.
  1045.  
  1046.  
  1047. DEFINING MATCHES                    *:syn-match*
  1048.  
  1049. :sy[ntax] match {group-name} [{options}] {pattern} [{options}]
  1050.  
  1051.     This defines one match.
  1052.  
  1053.     {group-name}        A syntax group name such as "Comment".
  1054.     [{options}]        See |:syn-arguments| below.
  1055.     {pattern}        The search pattern that defines the match.
  1056.                 See |:syn-pattern| below.
  1057.  
  1058.     Example (match a character constant):
  1059. >  :syntax match Character /'.'/s+1e-1
  1060.  
  1061.  
  1062. DEFINING REGIONS    *:syn-region* *:syn-start* *:syn-skip* *:syn-end*
  1063.  
  1064. :sy[ntax] region {group-name} [{options}]
  1065.         [matchgroup={group_name}]
  1066.         [keepend]
  1067.         start={start_pattern} ..
  1068.         [skip={skip_pattern}]
  1069.         end={end_pattern} ..
  1070.         [{options}]
  1071.  
  1072.     This defines one region.  It may span several lines.
  1073.  
  1074.     {group-name}        A syntax group name such as "Comment".
  1075.     [{options}]        See |:syn-arguments| below.
  1076.     [matchgroup={group-name}]  The syntax group to use for the following
  1077.                 start or end pattern matches only.  Not used
  1078.                 for the text in between the matched start and
  1079.                 end patterns.  Use NONE to reset to not using
  1080.                 a different group for the start or end match.
  1081.                 See |:syn-matchgroup|.
  1082.     keepend            Don't allow contained matches to go past a
  1083.                 match with the end pattern.  See
  1084.                 |:syn-keepend|.
  1085.     start={start_pattern}    The search pattern that defines the start of
  1086.                 the region.  See |:syn-pattern| below.
  1087.     skip={skip_pattern}    The search pattern that defines text inside
  1088.                 the region where not to look for the end
  1089.                 pattern.  See |:syn-pattern| below.
  1090.     end={end_pattern}    The search pattern that defines the end of
  1091.                 the region.  See |:syn-pattern| below.
  1092.  
  1093.     Example:
  1094. >  :syntax region String   start=+"+  skip=+\\"+  end=+"+
  1095.  
  1096.     The start/skip/end patterns and the options can be given in any order.
  1097.     There can be zero or one skip pattern.  There must be one or more
  1098.     start and end patterns.  This means that you can omit the skip
  1099.     pattern, but you must give at least one start and one end pattern.  It
  1100.     is allowed to have white space before and after the equal sign
  1101.     (although it mostly looks better without white space).
  1102.  
  1103.     When more than one start pattern is given, a match with one of these
  1104.     is sufficient.  This means there is an OR relation between the start
  1105.     patterns.  The first one that matches is used.  The same is true for
  1106.     the end patterns.
  1107.  
  1108.     The search for the end pattern starts at the start of the region.
  1109.     This implies that it can also match inside the start pattern!
  1110.  
  1111.     Note: The decision to start a region is only based on a matching start
  1112.     pattern.  There is no check for a matching end pattern.  This does NOT
  1113.     work:
  1114.         :syn region First  start="("  end="."
  1115.         :syn region Second start="("  end=";"
  1116.     The Second always matches before the First (last defined pattern has
  1117.     higher priority).  The Second region then continues until the next
  1118.     ';', no matter if there is a '.' before it.
  1119.  
  1120.                             *:syn-keepend*
  1121.     By default, a contained match can obscure a match for the end pattern.
  1122.     This is useful for nesting.  For example, a region that starts with
  1123.     "{" and ends with "}", can contain another region.  An encountered "}"
  1124.     will then end the contained region, but not the outer region:
  1125.         {        starts outer "{}" region
  1126.         {    starts contained "{}" region
  1127.         }    ends contained "{}" region
  1128.         }        ends outer "{} region
  1129.     If you don't want this, the "keepend" argument will make the matching
  1130.     of an end pattern of the outer region also end any contained item.
  1131.     This makes it impossible to nest the same region, but allows for
  1132.     contained items to highlight parts of the end pattern, without causing
  1133.     that to skip the match with the end pattern.  Example:
  1134. >  :syn match  VimComment +"[^"]\+$+
  1135. >  :syn region VimCommand start="set" end="$" contains=VimComment keepend
  1136.     The "keepend" makes the VimCommand always end at the end of the line,
  1137.     even though the contained VimComment includes a match with the <EOL>.
  1138.  
  1139.     When "keepend" is not used, a match with an end pattern is retried
  1140.     after each contained match.  When "keepend" is included, the first
  1141.     encountered match with an end pattern is used, truncating any
  1142.     contained matches.
  1143.  
  1144.                             *:syn-matchgroup*
  1145.     "matchgroup" can be used to highlight the start and/or end pattern
  1146.     differently than the body of the region.  Example:
  1147. >  :syntax region String matchgroup=Quote start=+"+  skip=+\\"+  end=+"+
  1148.     This will highlight the quotes with the "Quote" group, and the text in
  1149.     between with the "String" group.
  1150.     The "matchgroup" is used for all start and end patterns that follow,
  1151.     until the next "matchgroup".  Use "matchgroup=NONE" to go back to not
  1152.     using a matchgroup.
  1153.  
  1154.     It is not possible to have a contained match in a start or end pattern
  1155.     that is highlighted with "matchgroup".
  1156.     When using "transparent", it does not apply to a start or end pattern
  1157.     that is highlighted with "matchgroup".
  1158.  
  1159. ==============================================================================
  1160. 6. :syntax arguments                    *:syn-arguments*
  1161.  
  1162. The :syntax commands that define syntax items take a number of arguments.
  1163. The common ones are explained here.  The arguments may be given in any order
  1164. and may be mixed with patterns.
  1165.  
  1166. Not all commands accept all arguments.  This table shows which arguments
  1167. can be used for each command:
  1168.  
  1169.          contained  nextgroup  skip*   transparent  contains  oneline ~
  1170. :syntax keyword        yes           yes    yes       yes           -     -
  1171. :syntax match        yes           yes    yes       yes          yes     -
  1172. :syntax region        yes           yes    yes       yes          yes    yes
  1173.  
  1174.  
  1175. contained                        *:syn-contained*
  1176.  
  1177. When the "contained" argument is given, this item will not be recognized at
  1178. the top level, but only when it is mentioned in the "contains" field of
  1179. another match.  Example:
  1180. >   :syntax keyword Todo    TODO    contained
  1181. >   :syntax match   Comment "//.*"  contains=Todo
  1182.  
  1183.  
  1184. transparent                        *:syn-transparent*
  1185.  
  1186. If the "transparent" argument is given, this item will not be highlighted
  1187. itself, but will take the highlighting of the item it is contained in.  This
  1188. is useful for syntax items that don't need any highlighting but are used
  1189. only to skip over a part of the text.  The same groups as the item it is
  1190. contained in are used, unless a "contains" argument is given too.
  1191.  
  1192.  
  1193. oneline                            *:syn-oneline*
  1194.  
  1195. The "oneline" argument indicates that the region does not cross a line
  1196. boundary.  It must match completely in the current line.  However, when the
  1197. region has a contained item that does cross a line boundary, it continues on
  1198. the next line anyway.  A contained item can be used to recognize a line
  1199. continuation pattern.
  1200.  
  1201.  
  1202. contains={groupname},..                    *:syn-contains*
  1203.  
  1204. The "contains" argument is followed by a list of syntax group names.  These
  1205. groups will be allowed to begin inside the item (they may extend past the
  1206. containing group's end).  This allows for recursive nesting of matches and
  1207. regions.  If there is no "contains" argument, no groups will be contained in
  1208. this item.  The group names do not need to be defined before they can be used
  1209. here.
  1210.  
  1211. contains=ALL
  1212.         If the only item in the contains list is "ALL", then all
  1213.         groups will be accepted inside the item.
  1214.  
  1215. contains=ALLBUT,{group-name},..
  1216.         If the first item in the contains list is "ALLBUT", then all
  1217.         groups will be accepted inside the item, except the ones that
  1218.         are listed, and the "contained" items.  Example:
  1219. >  :syntax region Block start="{" end="}" ... contains=ALLBUT,Function
  1220.  
  1221. The {group-name} in the "contains" list can be a pattern.  All group names
  1222. that match the pattern will be included (or excluded, if "ALLBUT" is used).
  1223. The pattern cannot contain white space or a ','.  Example:
  1224. >  ... contains=Comment.*,Keyw[0-3]
  1225. The matching will be done at moment the syntax command is executed.  Groups
  1226. that are defined later will not be matched.  Also, if the current syntax
  1227. command defines a new group, this is not matched.  Be careful: When putting
  1228. syntax commands in a file you can't rely on groups NOT being defined, because
  1229. the file may have been sourced before, and "syn clear" doesn't remove the
  1230. group names.
  1231.  
  1232.  
  1233. nextgroup={groupname},..                *:syn-nextgroup*
  1234.  
  1235. The "nextgroup" argument is followed by a list of syntax group names,
  1236. separated by commas (just like with "contains", so you can also use patterns).
  1237.  
  1238. If the "nextgroup" argument is given, the mentioned syntax groups will be
  1239. tried for a match, after the match or region ends.  If none of the groups have
  1240. a match, highlighting continues normally.  If there is a match, this group
  1241. will used, even when it is not mentioned in the "contains" field of the
  1242. current group.  This is like giving the mentioned group priority over all
  1243. other groups.  Example:
  1244. >   :syntax match  ccFoobar  "Foo.\{-}Bar"  contains=ccFoo
  1245. >   :syntax match  ccFoo     "Foo"        contained nextgroup=ccFiller
  1246. >   :syntax region ccFiller  start="."  matchgroup=ccBar  end="Bar"  contained
  1247.  
  1248. This will highlight "Foo" and "Bar" differently, and only when there is a
  1249. "Bar" after "Foo".  In the text line below, "f" shows where ccFoo is used for
  1250. highlighting, and "bbb" where ccBar is used.
  1251.  
  1252. >   Foo asdfasd Bar asdf Foo asdf Bar asdf
  1253. >   fff        bbb      fff      bbb
  1254.  
  1255. Note the use of ".\{-}" to skip as little as possible until the next Bar.
  1256. when ".*" would be used, the "asdf" in between "Bar" and "Foo" would be
  1257. highlighted according to the "ccFoobar" group, because the ccFooBar match
  1258. would include the first "Foo" and the last "Bar" in the line (see |pattern|).
  1259.  
  1260.  
  1261. skipwhite                        *:syn-skipwhite*
  1262. skipnl                            *:syn-skipnl*
  1263. skipempty                        *:syn-skipempty*
  1264.  
  1265. These arguments are only used in combination with "nextgroup".  They can be
  1266. used to allow the next group to match after skipping some text:
  1267.     skipwhite    skip over space and Tab characters
  1268.     skipnl        skip over the end of a line
  1269.     skipempty    skip over empty lines (implies a "skipnl")
  1270.  
  1271. When "skipwhite" is present, the white space is only skipped if there is no
  1272. next group that matches the white space.
  1273.  
  1274. When "skipnl" is present, the match with nextgroup may be found in the next
  1275. line.  This only happens when the current item ends at the end of the current
  1276. line!  When "skipnl" is not present, the nextgroup will only be found after
  1277. the current item in the same line.
  1278.  
  1279. When skipping text while looking for a next group, the matches for other
  1280. groups are ignored.  Only when no next group matches, other items are tried
  1281. for a match again.  This means that matching a next group and skipping white
  1282. space and <EOL>s has a higher priority than other items.
  1283.  
  1284. Example:
  1285. >  syn match ifstart "if.*"     nextgroup=ifline skipwhite skipempty
  1286. >  syn match ifline  "endif"    contained
  1287. >  syn match ifline  "[^ \t].*" nextgroup=ifline skipwhite skipempty contained
  1288. Note that the last match, which matches any non-white text, is put last,
  1289. otherwise the "endif" of the indent would never match, because the "[^ \t].*"
  1290. would match first.
  1291. Note that this example doesn't work for nested "if"s.  You need to add
  1292. "contains" arguments to make that work (omitted for simplicity of the
  1293. example).
  1294.  
  1295. ==============================================================================
  1296. 7. Syntax patterns                    *:syn-pattern*
  1297.  
  1298. In the syntax commands, a pattern must be surrounded by two identical
  1299. characters.  This is like it works for the ":s" command.  The most common to
  1300. use is the double quote.  But if the pattern contains a double quote, you can
  1301. use another character that is not used in the pattern.  Examples:
  1302. >  :syntax region Comment  start="/\*"  end="\*/"
  1303. >  :syntax region String   start=+"+    end=+"+   skip=+\\"+
  1304.  
  1305. See |pattern| for the explanation of what a pattern is.  Syntax patterns are
  1306. always interpreted like the 'magic' options is set, no matter what the actual
  1307. value of 'magic' is.  And the patterns are interpreted like the 'l' flag is
  1308. not included in 'cpoptions'.  This was done to make syntax files portable and
  1309. independent of 'compatible' and 'magic' settings.
  1310.  
  1311. Try to avoid patterns that can match an empty string, such as "[a-z]*".
  1312. This slows down the highlighting a lot, because it matches everywhere.
  1313.  
  1314. The pattern can be followed by a character offset.  This can be used to
  1315. change the highlighted part, and to change the text area included in the
  1316. match or region (which only matters when trying to match other items).  Both
  1317. are relative to the matched pattern.  The character offset for a skip
  1318. pattern can be used to tell where to continue looking for an end pattern.
  1319.  
  1320. The offset takes the form of "{what}={offset}"
  1321. The {what} can be one of seven strings:
  1322.  
  1323. ms    Match Start    offset for the start of the matched text
  1324. me    Match End    offset for the end of the matched text
  1325. hs    Highlight Start    offset for where the highlighting starts
  1326. he    Highlight End    offset for where the highlighting ends
  1327. rs    Region Start    offset for where the body of a region starts
  1328. re    Region End    offset for where the body of a region ends
  1329. lc    Leading Context    offset past "leading context" of pattern
  1330.  
  1331. The {offset} can be:
  1332.  
  1333. s    start of the matched pattern
  1334. s+{nr}    start of the matched pattern plus {nr} chars to the right
  1335. s-{nr}    start of the matched pattern plus {nr} chars to the left
  1336. e    end of the matched pattern
  1337. e+{nr}    end of the matched pattern plus {nr} chars to the right
  1338. e-{nr}    end of the matched pattern plus {nr} chars to the left
  1339. {nr}    (for "lc" only): start matching {nr} chars to the left
  1340.  
  1341. Examples: "ms=s+1", "hs=e-2", "lc=3".
  1342.  
  1343. Although all offsets are accepted after any pattern, they are not always
  1344. meaningful.  This table shows which offsets are actually used:
  1345.  
  1346.             ms   me   hs   he   rs   re      lc ~
  1347. match item        yes  yes  yes  yes  -    -    yes
  1348. region item start   yes  -    yes  -    yes  -    yes
  1349. region item skip    -    yes  -    -    -    -    -
  1350. region item end     -    yes  -    yes  -    yes  -
  1351.  
  1352. Offsets can be concatenated, with a ',' in between.  Example:
  1353. >  syn match String  /".*"/hs=s+1,he=e-1
  1354.  
  1355.     some "string" text
  1356.       ^^^^^^        highlighted
  1357.  
  1358. Notes:
  1359. - There must be no white space between the pattern and the character
  1360.   offset(s).
  1361. - The highlighted area will never be outside of the matched text.
  1362. - A negative offset for an end pattern may not always work, because the end
  1363.   pattern may be detected when the highlighting should already have stopped.
  1364.  
  1365. Example (match a comment but don't highlight the /* and */):
  1366. >  :syntax region Comment start="/\*"hs=e+1 end="\*/"he=s-1
  1367.  
  1368.     /* this is a comment */
  1369.       ^^^^^^^^^^^^^^^^^^^     highlighted
  1370.  
  1371. A more complicated Example:
  1372. >  :syn region Exa matchgroup=Foo start="foo"hs=s+2,rs=e+2 matchgroup=Bar end="bar"me=e-1,he=e-1,re=s-1
  1373.  
  1374.      abcfoostringbarabc
  1375.         mmmmmmmmmmm        match
  1376.           ssrrrreee        highlight start/region/end ("Foo", "Exa" and "Bar")
  1377.  
  1378. Leading context            *:syn-lc* *:syn-leading* *:syn-context*
  1379.  
  1380. The "lc" offset specifies leading context -- a part of the pattern that must
  1381. be present, but is not considered part of the match.  An offset of "lc=n" will
  1382. cause Vim to step back n columns before attempting the pattern match, allowing
  1383. characters which have already been matched in previous patterns to also be
  1384. used as leading context for this match.  This can be used, for instance, to
  1385. specify that an "escaping" character must not precede the match:
  1386.  
  1387. >  :syn match ZNoBackslash "[^\\]z"ms=s+1
  1388. >  :syn match WNoBackslash "[^\\]w"lc=1
  1389. >  :syn match Underline "_\+"
  1390.  
  1391.       ___zzzz ___wwww
  1392.       ^^^     ^^^      matches Underline
  1393.           ^ ^      matches ZNoBackslash
  1394.              ^^^^ matches WNoBackslash
  1395.  
  1396. The "ms" offset is automatically set to the same value as the "lc" offset,
  1397. unless you set "ms" explicitly.
  1398.  
  1399. ==============================================================================
  1400. 8. Syntax clusters                    *:syn-cluster*
  1401.  
  1402. :sy[ntax] cluster {cluster-name} [contains={group-name}..]
  1403.                  [add={group-name}..]
  1404.                  [remove={group-name}..]
  1405.  
  1406. This command allows you to cluster a list of syntax groups together under a
  1407. single name.
  1408.  
  1409.     contains={group-name}..
  1410.         The cluster is set to the specified list of groups.
  1411.     add={group-name}..
  1412.         The specified groups are added to the cluster.
  1413.     remove={group-name}..
  1414.         The specified groups are removed from the cluster.
  1415.  
  1416. A cluster so defined may be referred to in a contains=.., nextgroup=.., add=..
  1417. or remove=.. list with a "@" prefix.  You can also use this notation to
  1418. implicitly declare a cluster before specifying its contents.
  1419.  
  1420. Example:
  1421. >   :syntax match Thing "# [^#]\+ #" contains=@ThingMembers
  1422. >   :syntax cluster ThingMembers contains=ThingMember1,ThingMember2
  1423.  
  1424. As the previous example suggests, modifications to a cluster are effectively
  1425. retroactive; the membership of the cluster is checked at the last minute, so
  1426. to speak:
  1427. >   :syntax keyword A aaa
  1428. >   :syntax cluster AandB contains=A
  1429. >   :syntax match Stuff "( aaa bbb )" contains=@AandB
  1430. >   :syntax cluster AandB add=B    " now both keywords are matched in Stuff
  1431.  
  1432. This also has implications for nested clusters:
  1433. >   :syntax keyword A aaa
  1434. >   :syntax keyword B bbb
  1435. >   :syntax cluster SmallGroup contains=B
  1436. >   :syntax cluster BigGroup contains=A,@SmallGroup
  1437. >   :syntax match Stuff "( aaa bbb )" contains=@BigGroup
  1438. >   :syntax cluster BigGroup remove=B    " no effect, since B isn't in BigGroup
  1439. >   :syntax cluster SmallGroup remove=B  " now bbb isn't matched within Stuff
  1440.  
  1441. ==============================================================================
  1442. 9. Including syntax files                *:syn-include*
  1443.  
  1444. It is often useful for one language's syntax file to include a syntax file for
  1445. a related language.  Depending on the exact relationship, this can be done in
  1446. two different ways:
  1447.  
  1448.     - If top-level syntax items in the included syntax file are to be
  1449.       allowed at the top level in the including syntax, you can simply use
  1450.       the |:source| command:
  1451.  
  1452. >  " In cpp.vim:
  1453. >  :source <sfile>:p:h/c.vim
  1454.  
  1455.     - If top-level syntax items in the included syntax file are to be
  1456.       contained within a region in the including syntax, you can use the
  1457.       ":syntax include" command:
  1458.  
  1459. :sy[ntax] include [@{grouplist-name}] {file-name}
  1460.  
  1461.       All syntax items declared in the included file will have the
  1462.       "contained" flag added.  In addition, if a group list is specified,
  1463.       all top-level syntax items in the included file will be added to
  1464.       that list.
  1465.  
  1466. >   " In perl.vim:
  1467. >   :syntax include @Pod <sfile>:p:h/pod.vim
  1468. >   :syntax region perlPOD start="^=head" end="^=cut" contains=@Pod
  1469.  
  1470. ==============================================================================
  1471. 10. Synchronizing                    *:syn-sync*
  1472.  
  1473. Vim wants to be able to start redrawing in any position in the document.  To
  1474. make this possible it needs to know the syntax item at the position where
  1475. redrawing starts.
  1476.  
  1477. :sy[ntax] sync [ccomment [group-name] | minlines={N} | ...]
  1478.  
  1479. There are three ways to synchronize:
  1480. 1. Based on C-style comments.  Vim understands how C-comments work and can
  1481.    figure out if the current line starts inside or outside a comment.
  1482. 2. Jumping back a certain number of lines and start parsing there.
  1483. 3. Searching backwards in the text for a pattern to sync on.
  1484.  
  1485. For all three methods, the line range where the parsing can start is limited
  1486. by "minlines" and "maxlines".
  1487.  
  1488. If the "minlines={N}" argument is given, the parsing always starts at least
  1489. that many lines backwards.  This can be used if the parsing may take a few
  1490. lines before it's correct, or when it's not possible to use syncing.
  1491.  
  1492. If the "maxlines={N}" argument is given, the number of lines that are searched
  1493. for a comment or syncing pattern is restricted to N lines backwards (after
  1494. adding "minlines".  This is useful if you have few things to sync on and a
  1495. slow machine.  Example:
  1496. >  :syntax sync ccomment maxlines=500
  1497.  
  1498.  
  1499. First syncing method:
  1500.  
  1501. For the first method, only the "ccomment" argument needs to be given.
  1502. Example:
  1503. >  :syntax sync ccomment
  1504.  
  1505. When Vim finds that the line where displaying starts is inside a C-style
  1506. comment, the last region syntax item with the group-name "Comment" will be
  1507. used.  This requires that there is a region with the group-name "Comment"!
  1508. An alternate group name can be specified, for example:
  1509. >  :syntax sync ccomment javaComment
  1510. This means that the last item specified with "syn region javaComment" will be
  1511. used for the detected C comment region.  This only works properly if that
  1512. region does have a start pattern "\/*" and an end pattern "*\/".
  1513.  
  1514. The "maxlines" argument can be used to restrict the search to a number of
  1515. lines.  The "minlines" argument can be used to at least start a number of
  1516. lines back (e.g., for when there is some construct that only takes a few
  1517. lines, but it hard to sync on).
  1518.  
  1519. Note: Syncing on a C comment doesn't work properly when strings are used
  1520. that cross a line and contain a "*/".  Since letting strings cross a line
  1521. is a bad programming habit (many compilers give a warning message), and the
  1522. chance of a "*/" appearing inside a comment is very small, this restriction
  1523. is hardly ever noticed.
  1524.  
  1525.  
  1526. Second syncing method:
  1527.  
  1528. For the second method, only the "lines={N}" argument needs to be given.  Vim
  1529. will subtract {N} from the line number and start parsing there.  This means
  1530. {N} extra lines need to be parsed, which makes this method a bit slower.
  1531. Example:
  1532. >  :syntax sync lines=50
  1533.  
  1534. "lines" and "minlines" are equivalent.
  1535.  
  1536.  
  1537. Third syncing method:
  1538.  
  1539. The idea is to synchronize on the end of a few specific regions, called a
  1540. sync pattern.  Only regions can cross lines, so when we find the end of some
  1541. region, we might be able to know in which syntax item we are.  The search
  1542. starts in the line just above the one where redrawing starts.  From there
  1543. the search continues backwards in the file.
  1544.  
  1545. This works just like the non-syncing syntax ltems.  You can use contained
  1546. matches, nextgroup, etc.  But there are a few differences:
  1547. - Keywords cannot be used.
  1548. - The syntax items with the "sync" keyword form a completely separated group
  1549.   of syntax items.  You can't mix syncing groups and non-syncing groups.
  1550. - The matching works backwards in the buffer (line by line), instead of
  1551.   forwards.
  1552. - A line continuation pattern can be given.  It is used to decide which group
  1553.   of lines need to be searched like they were one line.  This means that the
  1554.   search for a match with the specified items starts in the first of the
  1555.   consecutive that contain the continuation pattern.
  1556. - When using "nextgroup" or "contains", this only works within one line (or
  1557.   group of continued lines).
  1558. - When a match with a sync pattern is found, the rest of the line (or group of
  1559.   continued lines) is searched for another match.  The last match is used.
  1560.   This is used when a line can contain both the start end the end of a region
  1561.   (e.g., in a C-comment like /* this */, the last "*/" is used).
  1562.  
  1563. There are two ways how a match with a sync pattern can be used:
  1564. 1. Parsing for highlighting starts where redrawing starts (and where the
  1565.    search for the sync pattern started).  The syntax group that is expected
  1566.    to be valid there must be specified.  This works well when the regions
  1567.    that cross lines cannot contain other regions.
  1568. 2. Parsing for highlighting continues just after the match.  The syntax group
  1569.    that is expected to be present just after the match must be specified.
  1570.    This can be used when the previous method doesn't work well.  It's much
  1571.    slower, because more text needs to be parsed.
  1572. Both types of sync patterns can be used at the same time.
  1573.  
  1574. Besides the sync patterns, other matches and regions can be specified, to
  1575. avoid finding unwanted matches.
  1576.  
  1577. [The reason that the sync patterns are given separately, is that mostly the
  1578. search for the sync point can be much simpler than figuring out the
  1579. highlighting.  The reduced number of patterns means it will go (much)
  1580. faster.]
  1581.  
  1582.                         *syn-sync-grouphere*
  1583.     :syntax sync match {sync-group-name} grouphere {group-name} "pattern" ..
  1584.  
  1585.     Define a match that is used for syncing.  {group-name} is the
  1586.     name of a syntax group that follows just after the match.  Parsing
  1587.     of the text for highlighting starts just after the match.  A region
  1588.     must exist for this {group-name}.  The first one defined will be used.
  1589.     "NONE" can be used for when there is no syntax group after the match.
  1590.  
  1591.                         *syn-sync-groupthere*
  1592.     :syntax sync match {sync-group-name} groupthere {group-name} "pattern" ..
  1593.  
  1594.     Like "grouphere", but {group-name} is the name of a syntax group that
  1595.     is to be used at the start of the line where searching for the sync
  1596.     point started.  The text between the match and the start of the sync
  1597.     pattern searching is assumed not to change the syntax highlighting.
  1598.     For example, in C you could search backwards for "/*" and "*/".  If
  1599.     "/*" is found first, you know that you are inside a comment, so the
  1600.     "groupthere" is "cComment".  If "*/" is found first, you know that you
  1601.     are not in a comment, so the "groupthere" is "NONE".  (in practice
  1602.     it's a bit more complicated, because the "/*" and "*/" could appear
  1603.     inside a string.  That's left as an exercise to the reader...).
  1604.  
  1605.     :syntax sync match ..
  1606.     :syntax sync region ..
  1607.  
  1608.     Without a "groupthere" argument.  Define a region or match that is
  1609.     skipped while searching for a sync point.
  1610.  
  1611.     :syntax sync linecont {pattern}
  1612.  
  1613.     When {pattern} matches in a line, it is considered to continue in
  1614.     the next line.  This means that the search for a sync point will
  1615.     consider the lines to be concatenated.
  1616.  
  1617. If the "maxlines={N}" argument is given too, the number of lines that are
  1618. searched for a match is restricted to N.  This is useful if you have very
  1619. few things to sync on and a slow machine.  Example:
  1620. >  :syntax sync maxlines=100
  1621.  
  1622. You can clear all sync settings with:
  1623. >  :syntax sync clear
  1624.  
  1625. You can clear specific sync patterns with:
  1626. >  :syntax sync clear {sync-group-name} ..
  1627.  
  1628. ==============================================================================
  1629. 11. Listing syntax items                *:syntax* *:sy* *:syn*
  1630.  
  1631. This commands lists all the syntax items:
  1632.  
  1633.     :sy[ntax] [list]
  1634.  
  1635. To show the syntax items for one syntax group:
  1636.  
  1637.     :sy[ntax] list {group-name}
  1638.  
  1639. To list the syntax groups in one group list:
  1640.  
  1641.     :sy[ntax] list @{grouplist-name}
  1642.  
  1643. See above for other arguments for the ":syntax" command.
  1644.  
  1645. Note that the ":syntax" command can be abbreviated to ":sy", although ":syn"
  1646. is mostly used, because it looks better.
  1647.  
  1648. ==============================================================================
  1649. 12. Highlight command                    *:highlight* *:hi*
  1650.  
  1651. There are two types of highlight groups:
  1652. - The ones used for specific languages.  For these the name starts with the
  1653.   name of the language.  Many of these don't have any attributes, but are
  1654.   linked to a group of the second type.
  1655. - The ones used for all languages.  These are also used for the 'highlight'
  1656.   option.
  1657.  
  1658. :hi[ghlight]        List all the current highlight groups that have
  1659.             attributes set.
  1660.  
  1661. :hi[ghlight] {group-name}
  1662.             List one highlight group.
  1663.  
  1664. :hi[ghlight] clear {group-name}
  1665. :hi[ghlight] {group-name} NONE
  1666.             Disable the highlighting for one highlight group.
  1667.  
  1668. :hi[ghlight] {group-name} {key}={arg} ..
  1669.             Add a highlight group, or change the highlighting for
  1670.             an existing group.  See below for the arguments
  1671.             |highlight-args|.
  1672.  
  1673. Normally a highlight group is added once, in the *.vim file.  This sets
  1674. the default values for the highlighting.  After that, you can use additional
  1675. highlight commands to change the arguments that you want to set to
  1676. non-default values.  The value "NONE" can be used to switch the value off or
  1677. go back to the default value.
  1678.  
  1679. Example.  The syntax.vim file contains this line:
  1680. >  hi Comment    term=bold ctermfg=Cyan guifg=#80a0ff
  1681.  
  1682. You can change this by giving another ":highlight: command:
  1683. >  hi Comment    gui=bold
  1684.  
  1685. Note that all settings that are not included remain the same, only the
  1686. specified field is used, and settings are merged with previous ones.  So, the
  1687. result is like this single command has been used:
  1688. >  hi Comment    term=bold ctermfg=Cyan guifg=#80a0ff gui=bold
  1689.  
  1690.                         *highlight-args*
  1691. There are three types of terminals for highlighting:
  1692. term    a normal terminal (vt100, xterm)
  1693. cterm    a color terminal (MS-DOS console, color-xterm, these have the "Co"
  1694.     termcap entry)
  1695. gui    the GUI
  1696.  
  1697. For each type the highlighting can be given.  This makes it possible to use
  1698. the same syntax file on all terminals, and use the optimal highlighting.
  1699.  
  1700. 1. highlight arguments for normal terminals
  1701.  
  1702. term={attr-list}                *attr-list* *highlight-term*
  1703.     attr-list is a comma separated list (without spaces) of the
  1704.     following items (in any order):
  1705.         bold
  1706.         underline
  1707.         reverse
  1708.         inverse        same as reverse
  1709.         italic
  1710.         standout
  1711.         NONE        no attributes used (used to reset it)
  1712.  
  1713.     Note that "bold" can be used here and by using a bold font.  They
  1714.     have the same effect.
  1715.  
  1716. start={term-list}                *highlight-start*
  1717. stop={term-list}                *term-list* *highlight-stop*
  1718.     These lists of terminal codes can be used to get
  1719.     non-standard attributes on a terminal.
  1720.  
  1721.     The escape sequence specified with the "start" argument
  1722.     is written before the characters in the highlighted
  1723.     area.  It can be anything that you want to send to the
  1724.     terminal to highlight this area.  The escape sequence
  1725.     specified with the "stop" argument is written after the
  1726.     highlighted area.  This should undo the "start" argument.
  1727.     Otherwise the screen will look messed up.
  1728.  
  1729.     The {term-list} can have two forms:
  1730.  
  1731.     1. A string with escape sequences.
  1732.        This is any string of characters, except that it can't start with
  1733.        "t_" and blanks are not allowed.  The <> notation is recognized
  1734.        here, so you can use things like "<Esc>" and "<Space>".  Example:
  1735.         start=<Esc>[27h;<Esc>[<Space>r;
  1736.  
  1737.     2. A list of terminal codes.
  1738.        Each terminal code has the form "t_xx", where "xx" is the name of
  1739.        the termcap entry.  The codes have to be separated with commas.
  1740.        White space is not allowed.  Example:
  1741.         start=t_C1,t_BL
  1742.        The terminal codes must exist for this to work.
  1743.  
  1744.  
  1745. 2. highlight arguments for color terminals
  1746.  
  1747. cterm={attr-list}                    *highlight-cterm*
  1748.     See above for the description of {attr-list} |attr-list|.
  1749.     The "cterm" argument is likely to be different from "term", when
  1750.     colors are used.  For example, in a normal terminal comments could
  1751.     be underlined, in a color terminal they can be made Blue.
  1752.     Note: Many terminals (e.g., DOS console) can't mix these attributes
  1753.     with coloring.  Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=".
  1754.  
  1755. ctermfg={color-nr}                    *highlight-ctermfg*
  1756. ctermbg={color-nr}                    *highlight-ctermbg*
  1757.     The {color-nr} argument is a color number.  Its range is zero to
  1758.     (not including) the number given by the termcap entry "Co".
  1759.     The actual color with this number depends on the type of terminal
  1760.     and its settings.  Sometimes the color also depends on the settings of
  1761.     "cterm".  For example, on some systems "cterm=bold ctermfg=3" gives
  1762.     another color, on others you just get color 3.
  1763.  
  1764.     For an xterm this depends on your resources, and is a bit
  1765.     unpredictable.  See your xterm documentation for the defaults.  The
  1766.     colors for a color-xterm can be changed from the .Xdefaults file.
  1767.     Unfortunately this means that it's not possible to get the same colors
  1768.     for each user.  See |xterm-color| for info about color xterms.
  1769.  
  1770.     The MSDOS standard colors are fixed (in a console window), so these
  1771.     have been used for the names.  But the meaning of color names in X11
  1772.     are fixed, so these color settings have been used, to make the
  1773.     highlighting settings portable (complicated, isn't it?).  The
  1774.     following names are recognized, with the color number used:
  1775.  
  1776.         NR-16   NR-8    COLOR NAME ~
  1777.                             *cterm-colors*
  1778.         0        0        Black
  1779.         1        4        DarkBlue
  1780.         2       2        DarkGreen
  1781.         3       6        DarkCyan
  1782.         4       1        DarkRed
  1783.         5       5        DarkMagenta
  1784.         6       3        Brown
  1785.         7       7        LightGray, LightGrey, Gray, Grey
  1786.         8        0*        DarkGray, DarkGrey
  1787.         9        4*        Blue, LightBlue
  1788.         10        2*        Green, LightGreen
  1789.         11        6*        Cyan, LightCyan
  1790.         12        1*        Red, LightRed
  1791.         13        5*        Magenta, LightMagenta
  1792.         14        3*        Yellow
  1793.         15        7*        White
  1794.  
  1795.     The number under "NR-16" is used for 16-color terminals ('t_Co'
  1796.     greater than or equal to 16).  The number under "NR-8" is used for
  1797.     8-color terminals ('t_Co' less than 16).  The '*' indicates that the
  1798.     bold attribute is set for ctermfg.  In many 8-color terminals (e.g.,
  1799.     "linux"), this causes the bright colors to appear.  This doesn't work
  1800.     for background colors!  Without the '*' the bold attribute is removed.
  1801.     If you want to set the bold attribute in a different way, put a
  1802.     "cterm=" argument AFTER the "ctermfg=" or "ctermbg=" argument.  Or use
  1803.     a number instead of a color name.
  1804.  
  1805.     The case of the color names is ignored.
  1806.     Note that for 16 color ansi style terminals (including xterms), the
  1807.         numbers in the NR-8 column is used. Here '*' means 'add 8' so that Blue
  1808.         is 12, DarkGray is 8 etc.
  1809.  
  1810.     Note that for some color terminals these names may result in the wrong
  1811.     colors!
  1812.  
  1813.     When setting the "ctermfg" or "ctermbg" colors for the Normal group,
  1814.     these will become the colors used for the non-highlighted text.
  1815.     When setting the "ctermbg" color for the Normal group, the
  1816.     'background' option will be adjusted automatically.  This causes the
  1817.     highlight groups that depend on 'background' to change!  This means
  1818.     you should set the colors for Normal first, before setting other
  1819.     colors.
  1820.  
  1821.     When you have set "ctermfg" or "ctermbg" for the Normal group, Vim
  1822.     needs to reset the color when exiting.  This is done with the "op"
  1823.     termcap entry |t_op|.  If this doesn't work correctly, try setting the
  1824.     't_op' option in your .vimrc.
  1825.  
  1826.     When Vim knows the normal foreground and background colors, "fg" and
  1827.     "bg" can be used as color names.  This only works after setting the
  1828.     colors for the Normal group and for the MS-DOS console.  Example, for
  1829.     reverse video:
  1830. >        :highlight Visual ctermfg=bg ctermbg=fg
  1831.     Note that the colors are used that are valid at the moment this
  1832.     command are given.  If the Normal group colors are changed later, the
  1833.     "fg" and "bg" colors will not be adjusted.
  1834.  
  1835.  
  1836. 3. highlight arguments for the GUI
  1837.  
  1838. gui={attr-list}                        *highlight-gui*
  1839.     These give the attributes to use in the GUI mode.
  1840.     See |attr-list| for a description.
  1841.     Note that "bold" can be used here and by using a bold font.  They
  1842.     have the same effect.
  1843.  
  1844. font={font-name}                    *highlight-font*
  1845.     font-name is the name of a font, as it is used on the system Vim
  1846.     runs on.  For X11 this is a complicated name, for example:
  1847. >  font=-misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
  1848.  
  1849.     The font-name "NONE" can be used to revert to the default font.
  1850.     When setting the font for the "Normal" group, this becomes the default
  1851.     font (until the 'guifont' option is changed; the last one set is
  1852.     used).  All fonts used should be of the same character size as the
  1853.     default font!  Otherwise redrawing problems will occur.
  1854.     Setting the font does not work for the "Menu" group.
  1855.  
  1856. guifg={color-name}                    *highlight-guifg*
  1857. guibg={color-name}                    *highlight-guibg*
  1858.     These give the foreground (guifg) and background (guibg) color to
  1859.     use in the GUI.  There are a few special names:
  1860.         NONE        no color (transparent)
  1861.         bg        use normal background color
  1862.         background    use normal background color
  1863.         fg        use normal foreground color
  1864.         foreground    use normal foreground color
  1865.     To use a color name with an embedded space or other special character,
  1866.     put it in single quotes.  The single quote cannot be used then.
  1867.     Example:
  1868. >        :hi comment guifg='salmon pink'
  1869.  
  1870.                             *gui-colors*
  1871.     Suggested color names (these are available on most systems):
  1872.         Red        LightRed    DarkRed
  1873.         Green    LightGreen    DarkGreen    SeaGreen
  1874.         Blue    LightBlue    DarkBlue    SlateBlue
  1875.         Cyan    LightCyan    DarkCyan
  1876.         Magenta    LightMagenta    DarkMagenta
  1877.         Yellow    LightYellow    Brown
  1878.         Gray    LightGray    DarkGray
  1879.         Black    White
  1880.         Orange    Purple        Violet
  1881.  
  1882.     In the Win32 GUI version, additional system colors are available.  See
  1883.     |win32-colors|.
  1884.  
  1885.     You can also specify a color by its Red, Green and Blue values.
  1886.     The format is "#rrggbb", where
  1887.         "rr"    is the Red value
  1888.         "bb"    is the Blue value
  1889.         "gg"    is the Green value
  1890.     All values are hexadecimal, range from "00" to "ff".  Examples:
  1891. >  :highlight Comment guifg=#11f0c3 guibg=#ff00ff
  1892.  
  1893.                     *highlight-groups* *highlight-default*
  1894. These are the default highlighting groups.  These groups are used by the
  1895. 'highlight' option default.  Note that the highlighting depends on the value
  1896. of 'background'.  You can see the current settings with the ":highlight"
  1897. command.
  1898.                             *hl-Cursor*
  1899. Cursor        the character under the cursor
  1900.                             *hl-Directory*
  1901. Directory    directory names (and other special names in listings)
  1902.                             *hl-ErrorMsg*
  1903. ErrorMsg    error messages on the command line.
  1904.                             *hl-IncSearch*
  1905. IncSearch    'incsearch' highlighting
  1906.                             *hl-ModeMsg*
  1907. ModeMsg        'showmode' message (e.g., "-- INSERT --")
  1908.                             *hl-MoreMsg*
  1909. MoreMsg        |more-prompt|
  1910.                             *hl-NonText*
  1911. NonText        '~' and '@' at the end of the window and characters from
  1912.         'showbreak'
  1913.                             *hl-Question*
  1914. Question    |hit-return| prompt and yes/no questions
  1915.                             *hl-SpecialKey*
  1916. SpecialKey    Meta and special keys listed with ":map"
  1917.                             *hl-StatusLine*
  1918. StatusLine    status line of current window
  1919.                             *hl-StatusLineNC*
  1920. StatusLineNC    status lines of not-current windows
  1921.                             *hl-Title*
  1922. Title        titles for output from ":set all", ":autocmd" etc.
  1923.                             *hl-Visual*
  1924. Visual        Visual mode selection
  1925.                             *hl-VisualNOS*
  1926. VisualNOS    Visual mode selection when vim is "Not Owning the Selection".
  1927.             Only X11 Gui's |gui-x11| and |xterm-clipboard| supports this.
  1928.                             *hl-WarningMsg*
  1929. WarningMsg    warning messages
  1930.                             *hl-WildMenu*
  1931. WildMenu    current match in 'wildmenu' completion
  1932.                             *hl-LineNr*
  1933. LineNr        line number for ":number" and ":#" commands, and when 'number'
  1934.         option is set.
  1935.                             *hl-Normal*
  1936. Normal        normal text
  1937.                             *hl-Search*
  1938. Search        last search pattern highlighting (see 'hlsearch')
  1939.  
  1940.                             *hl-User1..9*
  1941. The 'statusline' syntax allows the use of 9 different highlights in the
  1942. statusline and ruler (via 'rulerformat'). The names are User1 to User9.
  1943.  
  1944. For the GUI you can use these groups to set the colors for the menu and
  1945. scrollbars.  They don't have defaults.  This doesn't work for the Win32 GUI.
  1946.     Menu                            *hl-Menu*
  1947.     Scrollbar                            *hl-Scrollbar*
  1948.  
  1949. ==============================================================================
  1950. 13. Linking groups                    *:highlight-link*
  1951.  
  1952. When you want to use the same highlighting for several syntax groups, you
  1953. can do this more easily by linking the groups into one common highlight
  1954. group, and give the color attributes only for that group.
  1955.  
  1956.     :hi[ghlight][!] link {from-group} {to-group}
  1957.  
  1958. Notes:
  1959. - If the {from-group} and/or {to-group} doesn't exist, it is created.  You
  1960.   don't get an error message for a non-existing group.
  1961. - If the {to-group} is "NONE", the link is removed from the {from-group}.
  1962. - As soon as you use a ":highlight" command for a linked group, the link is
  1963.   removed.
  1964. - If there are already highlight settings for the {from-group}, the link is
  1965.   not made, unless the '!' is given.  For a ":highlight link" command in a
  1966.   sourced file, you don't get an error message.  This can be used to skip
  1967.   links for groups that already have settings.
  1968.  
  1969. ==============================================================================
  1970. 14. Cleaning up                        *:syn-clear*
  1971.  
  1972. If you want to clear the syntax stuff for the current buffer, you can use this
  1973. command:
  1974. >  :syntax clear
  1975.  
  1976. This command should be used when you want to switch off syntax highlighting,
  1977. or when you want to switch to using another syntax.  It's a good idea to
  1978. include this command at the beginning of a syntax file.
  1979.  
  1980. If you want to disable syntax highlighting for all buffers, you need to remove
  1981. the autocommands that load the syntax files:
  1982. >  :syntax off
  1983.  
  1984. What this command actually does, is executing the command
  1985. >  source $VIMRUNTIME/syntax/nosyntax.vim
  1986. See the "nosyntax.vim" file for details.  Note that for this to work
  1987. $VIMRUNTIME must be valid.  See |$VIMRUNTIME|.
  1988.  
  1989. To clean up specific syntax groups for the current buffer:
  1990. >  :syntax clear {group-name} ..
  1991. This removes all patterns and keywords for {group-name}.
  1992.  
  1993. To clean up specific syntax group lists for the current buffer:
  1994. >  :syntax clear @{grouplist-name} ..
  1995. This sets {grouplist-name}'s contents to an empty list.
  1996.  
  1997. ==============================================================================
  1998. 15. Highlighting tags                    *tag-highlight*
  1999.  
  2000. If you want to highlight all the tags in your file, you can use the following
  2001. mappings.
  2002.  
  2003.     <F11>    -- Generate tags.vim file, and highlight tags.
  2004.     <F12>    -- Just highlight tags based on existing tags.vim file.
  2005.  
  2006. >  map <F11>  :sp tags<CR>:%s/^\([^    :]*:\)\=\([^    ]*\).*/syntax keyword Tag \2/<CR>:wq! tags.vim<CR>/^<CR><F12>
  2007. >  map <F12>  :so tags.vim<CR>
  2008.  
  2009. WARNING: The longer the tags file, the slower this will be, and the more
  2010. memory Vim will consume.
  2011.  
  2012. Only highlighting typedefs, unions and structs can be done too.  For this you
  2013. must use Exuberant ctags (included with Vim).
  2014.  
  2015. Put these lines in your Makefile:
  2016.  
  2017. # Make a highlight file for types.  Requires Exuberant ctags and awk
  2018. types: types.vim
  2019. types.vim: *.[ch]
  2020.     ctags -i=gstuS -o- *.[ch] |\
  2021.         awk 'BEGIN{printf("syntax keyword Type\t")}\
  2022.             {printf("%s ", $$1)}END{print ""}' > $@
  2023.  
  2024. And put these lines in your .vimrc:
  2025.  
  2026. >  " load the types.vim highlighting file, if it exists
  2027. >  autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') . '/types.vim'
  2028. >  autocmd BufRead,BufNewFile *.[ch] if filereadable(fname)
  2029. >  autocmd BufRead,BufNewFile *.[ch]   exe 'so ' . fname
  2030. >  autocmd BufRead,BufNewFile *.[ch] endif
  2031.  
  2032. ==============================================================================
  2033. 16. Color xterms                *xterm-color* *color-xterm*
  2034.  
  2035. Most color xterms have only eight colors.  They should work with these
  2036. lines in your .vimrc:
  2037. >  :if has("terminfo")
  2038. >  :  set t_Co=8
  2039. >  :  set t_Sf=<Esc>[3%p1%dm
  2040. >  :  set t_Sb=<Esc>[4%p1%dm
  2041. >  :else
  2042. >  :  set t_Co=8
  2043. >  :  set t_Sf=<Esc>[3%dm
  2044. >  :  set t_Sb=<Esc>[4%dm
  2045. >  :endif
  2046.     [<Esc> is a real escape, type CTRL-V <Esc>]
  2047.  
  2048. You might want to put these lines in an ":if" that checks the name of your
  2049. terminal, for example:
  2050. >  :if &term =~ "xterm"
  2051.    put above lines here
  2052. >  :endif
  2053.  
  2054. Note: Do these settings BEFORE doing ":syntax on".  Otherwise the colors may
  2055. be wrong.
  2056.                             *xiterm* *rxvt*
  2057. The above settings have been mentioned to work for xiterm and rxvt too.
  2058.  
  2059. To test your color setup, a file has been included in the Vim distribution.
  2060. To use it, execute these commands:
  2061. >  :e $VIMRUNTIME/syntax/colortest.vim
  2062. >  :so %
  2063.  
  2064. Some versions of xterm (and other terminals, like the linux console) can
  2065. output lighter foreground colors, even though the number of colors is defined
  2066. at 8.  Therefore Vim sets the "cterm=bold" attribute for light foreground
  2067. colors, when 't_Co' is 8.
  2068.  
  2069. To get 16 colors, get the newest xterm version (which should be included with
  2070. Xfree86 3.3).  You can also find the latest version at:
  2071.     http://www.clark.net/pub/dickey/xterm
  2072. You probably have to enable 16 colors when running configure:
  2073.     ./configure --disable-bold-color
  2074. If you only get 8 colors, check the xterm compilation settings.
  2075. (Also see |UTF8-xterm| for using this xterm with UTF-8 character encoding).
  2076.  
  2077. This xterm should work with these lines in your .vimrc:
  2078. >  :if has("terminfo")
  2079. >  :  set t_Co=16
  2080. >  :  set t_AB=<Esc>[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm
  2081. >  :  set t_AF=<Esc>[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm
  2082. >  :else
  2083. >  :  set t_Co=16
  2084. >  :  set t_Sf=<Esc>[3%dm
  2085. >  :  set t_Sb=<Esc>[4%dm
  2086. >  :endif
  2087.     [<Esc> is a real escape, type CTRL-V <Esc>]
  2088.  
  2089. Without |+terminfo|, Vim will recognize these settings, and automatically
  2090. translate cterm colors of 8 and above to "<Esc>[9%dm" and "<Esc>[10%dm".
  2091.  
  2092. Or just set the TERM environment variable to "xterm-16color" and try if that
  2093. works.
  2094.  
  2095. You probably want to use these X resources (in your ~/.Xdefaults file):
  2096.     XTerm*color0:            #000000
  2097.     XTerm*color1:            #c00000
  2098.     XTerm*color2:            #008000
  2099.     XTerm*color3:            #808000
  2100.     XTerm*color4:            #0000c0
  2101.     XTerm*color5:            #c000c0
  2102.     XTerm*color6:            #008080
  2103.     XTerm*color7:            #c0c0c0
  2104.     XTerm*color8:            #808080
  2105.     XTerm*color9:            #ff6060
  2106.     XTerm*color10:            #00ff00
  2107.     XTerm*color11:            #ffff00
  2108.     XTerm*color12:            #8080ff
  2109.     XTerm*color13:            #ff40ff
  2110.     XTerm*color14:            #00ffff
  2111.     XTerm*color15:            #ffffff
  2112.     Xterm*cursorColor:        Black
  2113.  
  2114. [Note: The cursorColor is required to work around a bug, which changes the
  2115. cursor color to the color of the last drawn text.  This has been fixed by a
  2116. newer version of xterm, but not everybody is it using yet.]
  2117.  
  2118. To get these right away, reload the .Xdefaults file to the X Option database
  2119. Manager (you only need to do this when you just changed the .Xdefaults file):
  2120. >  xrdb -merge ~/.Xdefaults
  2121.  
  2122.                             *hpterm-color*
  2123. These settings work (more or less) for a hpterm, which only supports 8
  2124. foreground colors:
  2125. >  :if has("terminfo")
  2126. >  :  set t_Co=8
  2127. >  :  set t_Sf=<Esc>[&v%p1%dS
  2128. >  :  set t_Sb=<Esc>[&v7S
  2129. >  :else
  2130. >  :  set t_Co=8
  2131. >  :  set t_Sf=<Esc>[&v%dS
  2132. >  :  set t_Sb=<Esc>[&v7S
  2133. >  :endif
  2134.     [<Esc> is a real escape, type CTRL-V <Esc>]
  2135.  
  2136.                         *Eterm* *enlightened-terminal*
  2137. These settings have been reported to work for the Enlightened terminal
  2138. emulator, or Eterm.  They might work for all xterm-like terminals that use the
  2139. bold attribute to get bright colors.  Add an ":if" like above when needed.
  2140. >      set t_Co=16
  2141. >      set t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{22}%+%d;1%;m
  2142. >      set t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{32}%+%d;1%;m
  2143.  
  2144.  vim:tw=78:ts=8:sw=4
  2145.