diff options
Diffstat (limited to 'runtime/doc/syntax.txt')
-rw-r--r-- | runtime/doc/syntax.txt | 91 |
1 files changed, 52 insertions, 39 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 6aed7441a0..81ba639dbe 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 7.4. Last change: 2015 Mar 29 +*syntax.txt* For Vim version 7.4. Last change: 2015 Dec 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -417,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: > *:TOhtml* :[range]TOhtml The ":TOhtml" command is defined in a standard plugin. This command will source |2html.vim| for you. When a - range is given, set |g:html_start_line| and - |g:html_end_line| to the start and end of the range, - respectively. Default range is the entire buffer. - - If the current window is part of a |diff|, unless - |g:html_diff_one_file| is set, :TOhtml will convert - all windows which are part of the diff in the current - tab and place them side-by-side in a <table> element - in the generated HTML. With |g:html_line_ids| you can - jump to lines in specific windows with (for example) - #W1L42 for line 42 in the first diffed window, or - #W3L87 for line 87 in the third. + range is given, this command sets |g:html_start_line| + and |g:html_end_line| to the start and end of the + range, respectively. Default range is the entire + buffer. + + If the current window is part of a |diff|, unless + |g:html_diff_one_file| is set, :TOhtml will convert + all windows which are part of the diff in the current + tab and place them side-by-side in a <table> element + in the generated HTML. With |g:html_line_ids| you can + jump to lines in specific windows with (for example) + #W1L42 for line 42 in the first diffed window, or + #W3L87 for line 87 in the third. Examples: > @@ -742,6 +743,22 @@ and UTF-32 instead, use: > Note that documents encoded in either UTF-32 or UTF-16 have known compatibility problems with some major browsers. + *g:html_font* +Default: "monospace" +You can specify the font or fonts used in the converted document using +g:html_font. If this option is set to a string, then the value will be +surrounded with single quotes. If this option is set to a list then each list +item is surrounded by single quotes and the list is joined with commas. Either +way, "monospace" is added as the fallback generic family name and the entire +result used as the font family (using CSS) or font face (if not using CSS). +Examples: > + + " font-family: 'Consolas', monospace; + :let g:html_font = "Consolas" + + " font-family: 'DejaVu Sans Mono', 'Consolas', monospace; + :let g:html_font = ["DejaVu Sans Mono", "Consolas"] +< *convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml* Default: 0. When 0, generate standard HTML 4.01 (strict when possible). @@ -1059,7 +1076,8 @@ CPP *cpp.vim* *ft-cpp-syntax* Most of things are same as |ft-c-syntax|. Variable Highlight ~ -cpp_no_c11 don't highlight C++11 standard items +cpp_no_cpp11 don't highlight C++11 standard items +cpp_no_cpp14 don't highlight C++14 standard items CSH *csh.vim* *ft-csh-syntax* @@ -1415,34 +1433,28 @@ form, then > :let fortran_fixed_source=1 in your vimrc prior to the :syntax on command. -If the form of the source code depends upon the file extension, then it is -most convenient to set fortran_free_source in a ftplugin file. For more -information on ftplugin files, see |ftplugin|. For example, if all your -fortran files with an .f90 extension are written in free source form and the -rest in fixed source form, add the following code to your ftplugin file > - let s:extfname = expand("%:e") - if s:extfname ==? "f90" - let fortran_free_source=1 - unlet! fortran_fixed_source - else - let fortran_fixed_source=1 - unlet! fortran_free_source - endif -Note that this will work only if the "filetype plugin indent on" command -precedes the "syntax on" command in your vimrc file. +If the form of the source code depends, in a non-standard way, upon the file +extension, then it is most convenient to set fortran_free_source in a ftplugin +file. For more information on ftplugin files, see |ftplugin|. Note that this +will work only if the "filetype plugin indent on" command precedes the "syntax +on" command in your .vimrc file. + When you edit an existing fortran file, the syntax script will assume free source form if the fortran_free_source variable has been set, and assumes fixed source form if the fortran_fixed_source variable has been set. If neither of these variables have been set, the syntax script attempts to -determine which source form has been used by examining the first five columns -of the first 250 lines of your file. If no signs of free source form are -detected, then the file is assumed to be in fixed source form. The algorithm -should work in the vast majority of cases. In some cases, such as a file that -begins with 250 or more full-line comments, the script may incorrectly decide -that the fortran code is in fixed form. If that happens, just add a -non-comment statement beginning anywhere in the first five columns of the -first twenty five lines, save (:w) and then reload (:e!) the file. +determine which source form has been used by examining the file extension +using conventions common to the ifort, gfortran, Cray, NAG, and PathScale +compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for +free-source). If none of this works, then the script examines the first five +columns of the first 500 lines of your file. If no signs of free source form +are detected, then the file is assumed to be in fixed source form. The +algorithm should work in the vast majority of cases. In some cases, such as a +file that begins with 500 or more full-line comments, the script may +incorrectly decide that the fortran code is in fixed form. If that happens, +just add a non-comment statement beginning anywhere in the first five columns +of the first twenty five lines, save (:w) and then reload (:e!) the file. Tabs in fortran files ~ Tabs are not recognized by the Fortran standards. Tabs are not a good idea in @@ -3430,7 +3442,7 @@ DEFINING KEYWORDS *:syn-keyword* :syntax keyword Type contained int long char :syntax keyword Type int long contained char :syntax keyword Type int long char contained -< *E789* +< *E789* *E890* When you have a keyword with an optional tail, like Ex commands in Vim, you can put the optional characters inside [], to define all the variations at once: > @@ -3684,6 +3696,7 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. +Another way to conceal text with with |matchadd()|. concealends *:syn-concealends* @@ -4130,7 +4143,7 @@ example, for instance, can be done like this: > As can be seen here, the \z actually does double duty. In the start pattern, it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it -changes the \1 back-reference into an external reference referring to the +changes the \z1 back-reference into an external reference referring to the first external sub-expression in the start pattern. External references can also be used in skip patterns: > :syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1" |