📄 syntax.txt
字号:
> let eiffel_ise=1Finally, some vendors support hexadecimal constants. To handle them, add> let eiffel_hex_constants=1to your startup file.ERLANG *erlang.vim*The erlang highlighting supports Erlang (ERicsson LANGuage).Erlang is case sensitive and default extension is ".erl".You can disable some highlighting groups if you put the following commands inyour .vimrc file:This command will disable comments, operators, strings and numbers:> let erlang_characters=1And for disabling keywords and functions you may use:> let erlang_functions=1> let erlang_keywords=1FORM *form.vim*The coloring scheme for syntax elements in the FORM file uses the defaultmodes Conditional, Number, Statement, Comment, PreProc, Type, and String,following the language specifications in 'Symbolic Manipulation with FORM'' byJ.A.M. Vermaseren, CAN, Netherlands, 1991.If you want include your own changes to the default colors, you have toredefine the following syntax groups: - formConditional - formNumber - formStatement - formHeaderStatement - formComment - formPreProc - formDirective - formType - formStringNote that the form.vim syntax file implements FORM preprocessor commands anddirectives per default in the same syntax group.A predefined enhanced color mode for FORM is available to distinguish betweenheader statements and statements in the body of a FORM program. To activatethis mode define the following variable in your vimrc file> let form_enhanced_color=1The enhanced mode also takes advantage of additional color features for a darkgvim display. Here, statements are colored LightYellow instead of Yellow, andconditionals are LightBlue for better distinction.FORTRAN *fortran.vim*Default highlighting and dialect ~Highlighting appropriate for f95 (Fortran 95) is used by default. This choiceshould be appropriate for most users most of the time because Fortran 95 is asuperset of Fortran 90 and almost a superset of Fortran 77.Fortran source code form ~Fortran 9x code can be in either fixed or free source form. Note that thesyntax highlighting will not be correct if the form is incorrectly set.When you create a new fortran file, the syntax script assumes fixed sourceform. If you always use free source form, then> :let fortran_free_source=1in your .vimrc prior to the :syntax on command.If the form of the source code depends upon the file extension, then it ismost convenient to set fortran_free_source with an autocommand.When you edit an existing fortran file, the syntax script will assume freesource form if the fortran_free_source variable has been set. If it has notbeen set, the syntax script attempts to determine which source form has beenused by examining the first five columns of the first 25 lines of your file.If no signs of free source form are detected, then the file is assumed to bein fixed source form. The algorithm should work in the vast majority of cases.In some cases, such as a file that begins with 25 or more full-line comments,the script may incorrectly decide that the fortran code is in fixed form. Ifthat happens, just add a non-comment statement beginning anywhere in the firstfive 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 infixed format fortran source code which requires fixed column boundaries.Therefore, tabs are marked as errors. Nevertheless, some programmers likeusing tabs. If your fortran files contain tabs, then you should set thevariable fortran_have_tabs in your .vimrc with a command such as> :let fortran_have_tabs=1placed prior to the :syntax on command. Unfortunately, the use of tabs willmean that the syntax file will not be able to detect incorrect margins.Non-default fortran dialects ~The syntax script supports five Fortran dialects: f95, f90, f77, the Laheysubset elf90, and the Imagine1 subset F.If you use f77 with extensions, even common ones like do/enddo loops, do/whileloops and free source form that are supported by most f77 compilers includingg77 (GNU Fortran), then you will probably find the default highlightingsatisfactory. However, if you use strict f77 with no extensions, not even freesource form or the MIL STD 1753 extensions, then the advantages of setting thedialect to f77 are that names such as SUM are recognized as user variablenames and not highlighted as f9x intrinsic functions, that obsolete constructssuch as ASSIGN statements are not highlighted as todo items, and that fixedsource form will be assumed.If you use elf90 or F, the advantage of setting the dialect appropriately isthat f90 features excluded from these dialects will be highlighted as todoitems and that free source form will be assumed as required for thesedialects.The dialect can be selected by setting the variable fortran_dialect. Thepermissible values of fortran_dialect are case-sensitive and must be "f95","f90", "f77", "elf" or "F". Invalid values of fortran_dialect are ignored.If all your fortran files use the same dialect, set fortran_dialect in your.vimrc prior to your syntax on statement. If the dialect depends upon the fileextension, then it is most convenient to use autocommands.Finer control is necessary if the file extension does not uniquely identifythe dialect. You can override the default dialect, on a file-by-file basis, byincluding a comment with the directive "fortran_dialect=xx" (where xx=f77 orelf or F or f90 or f95) in one of the first three lines in your file. Forexample, your older .f files may be written in extended f77 but your newerones may be F codes, and you would identify the latter by including in thefirst three lines of those files a Fortran comment of the form> ! fortran_dialect=FF overrides elf if both directives are present.Limitations ~Parenthesis checking does not catch too few closing parentheses. Hollerithstrings are not recognized. Some keywords may be highlighted incorrectlybecause Fortran90 has no reserved words.FVWM CONFIGURATION FILES *fvwm.vim*In order for Vim to recognize Fvwm configuration files that do not matchthe patterns *fvwmrc* or *fvwm2rc*, you must put additional patternsappropriate to your system in your myfiletypes.vim file. For thesepatterns, you must set the variable "b:fvwm_version" to the major versionnumber of Fvwm, and the 'filetype' option to fvwm.For example, to make Vim identify all files in /etc/X11/fvwm2/as Fvwm2 configuration files, add the following:> au! BufNewFile,BufRead /etc/X11/fvwm2/* let b:fvwm_version = 2 |> \ set filetype=fvwmIf you'd like Vim to highlight all valid color names, tell it where tofind the color database (rgb.txt) on your system. Do this by setting"rgb_file" to its location. Assuming your color database is locatedin /usr/X11/lib/X11/, you should add the line> let rgb_file = "/usr/X11/lib/X11/rgb.txt"to your .vimrc file.GSP *gsp.vim*The default coloring style for GSP pages is defined by |html.vim|, andthe coloring for java code (within java tags or inline between backticks)is defined by |java.vim|. The following HTML groups defined in |html.vim|are redefined to incorporate and highlight inline java code: htmlString htmlValue htmlEndTag htmlTag htmlTagNHighlighting should look fine most of the places where you'd see inlinejava code, but in some special cases it may not. To add another HTMLgroup where you will have inline java code where it does not highlightcorrectly, just copy the line you want from |html.vim| and add gspJavato the contains clause.The backticks for inline java are highlighted according to the htmlErrorgroup to make them easier to see.HTML *html.vim*The coloring scheme for tags in the HTML file works as follows.The <> of opening tags are colored differently than the </> of a closing tag.This is on purpose! For opening tags the 'Function' color is used, while forclosing tags the 'Type' color is used (See syntax.vim to check how those aredefined for you)Known tag names are colored the same way as statements in C. Unknown tagnames are colored with the same color as the <> or </> respectively whichmakes it easy to spot errorsNote that the same is true for argument (or attribute) names. Known attributenames are colored differently than unknown ones.Some HTML tags are used to change the rendering of text. The following tagsare recognized by the html.vim syntax coloring file and change the way normaltext is shown: <B> <I> <U> <EM> <STRONG> (<EM> is used as an alias for <I>,while <STRONG> as an alias for <B>), <H1> - <H6>, <HEAD>, <TITLE> and <A>, butonly if used as a link that is, it must include a href as in<A href="somfile.html">).If you want to change how such text is rendered, you must redefine thefollowing syntax groups: - htmlBold - htmlBoldUnderline - htmlBoldUnderlineItalic - htmlUnderline - htmlUnderlineItalic - htmlItalic - htmlLink for links - htmlTitle for titles - htmlH1 - htmlH6 for headingsTo make this redefinition work you must redefine them all with the exceptionof the last two (htmlTitle and htmlH[1-6], which are optional) and define thefollowing variable in your vimrc (this is due to the order in which the filesare read during initialization)> let html_my_rendering=1If you'd like to see an example download mysyntax.vim athttp://www.fleiner.com/vim/mysyntax.vimYou can also disable this rendering by adding the following line to yourvimrc file:> let html_no_rendering=1HTML comments are rather special (see an HTML reference document for thedetails), and the syntax coloring scheme will highlight all errors.However, if you prefer to use the wrong style (starts with <!-- andends with --!>) you can define> let html_wrong_comments=1JavaScript and Visual Basic embedded inside HTML documents are highlighted as'Special' with statements, comments, strings and so on colored as in standardprogramming languages. Note that only JavaScript and Visual Basic are currentlysupported, no other scripting language has been added yet.Embedded and inlined cascading style sheets (CSS) are highlighted too.There are several html preprocessor languages out there. html.vim has beenwritten such that it should be trivial to include it. To do so add thefollowing two lines to the syntax coloring file for that language(the example comes from the asp.vim file): source <sfile>:p:h/html.vim syn cluster htmlPreproc add=aspNow you just need to make sure that you add all regions that containthe preprocessor language to the cluster htmlPreproc.HTML/OS (by Aestiva) *htmlos.vim*The coloring scheme for HTML/OS works as follows:Functions and variable names are the same color by default, because VIMdoesn't specify different colors for Functions and Identifiers. To changethis (which is recommended if you want function names to be recognizable in adifferent color) you need to add the following line to either your ~/.vimrc:> :hi Function term=underline cterm=bold ctermfg=LightGrayOf course, the ctermfg can be a different color if you choose.Another issues that HTML/OS runs into is that there is no special filetype tosignify that it is a file with HTML/OS coding. You can change this by openinga file and turning on HTML/OS syntax by doing the following:> :set syntax=htmlosLastly, it should be noted that the opening and closing characters to begin ablock of HTML/OS code can either be << or [[ and >> or ]], respectively.IA64 *ia64.vim* *intel-itanium*Highlighting for the Intel Itanium 64 assembly language. See |asm.vim| forhow to recognize this filetype.To have *.inc files be recognized as IA64, add this to your .vimrc file:> :let g:filetype_inc = "ia64"INFORM *inform.vim*Inform highlighting includes symbols provided by the Inform Library, asmost programs make extensive use of it. If do not wish Library symbolsto be highlighted add this to your vim startup:> let inform_highlight_simple=1By default it is assumed that Inform programs are Z-machine targetted,and highlights Z-machine assembly language symbols appropriately. Ifyou intend your program to be targetted to a Glulx/Glk environment youneed to add this to your startup sequence:> let inform_highlight_glulx=1This will highlight Glulx opcodes instead, and also adds glk() to theset of highlighted system functions.JAVA *java.vim*The java.vim syntax highlighting file offers several options:In Java 1.0.2 it was never possible to have braces inside parens, so this wasflagged as an error. Since Java 1.1 this is possible (with anonymousclasses), and therefore is no longer marked as an error. If you prefer the oldway, put the following line into your vim startup file:> let java_mark_braces_in_parens_as_errors=1All identifiers in java.lang.* are always visible in all classes. Tohighlight them use:> let java_highlight_java_lang_ids=1You can also highlight identifiers of most standard java packagesif you download the script at http://www.fleiner.com/vim/syntax/javaid.vimIf you prefer to only highlight identifiers of a certain package, sayjava.io use the following:> let java_highligh_java_io=1Check the javaid.vim file for a list of all the packages that are supported.Function names are not highlighted, as the way to find functions depends onhow you write java code. The syntax file knows two possible ways to highlightfunctions:If you write function declarations that are always indented by eithera tab, 8 spaces or 2 spaces you may want to set> let java_highlight_functions="indent"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -