comparison runtime/doc/syntax.txt @ 237:73354c21f1e4 v7.0066

updated for version 7.0066
author vimboss
date Fri, 15 Apr 2005 21:13:42 +0000
parents 7fd4b5df33be
children 8d34af900bae
comparison
equal deleted inserted replaced
236:4707450c2b33 237:73354c21f1e4
1 *syntax.txt* For Vim version 7.0aa. Last change: 2005 Mar 19 1 *syntax.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
518 518
519 519
520 ANT *ant.vim* *ant-syntax* 520 ANT *ant.vim* *ant-syntax*
521 521
522 The ant syntax file provides syntax highlighting for javascript and python 522 The ant syntax file provides syntax highlighting for javascript and python
523 by default. Syntax highlighting for other script languages can be installed 523 by default. Syntax highlighting for other script languages can be installed
524 by the function AntSyntaxScript(), which takes the tag name as first argument 524 by the function AntSyntaxScript(), which takes the tag name as first argument
525 and the script syntax file name as second argument. Example: > 525 and the script syntax file name as second argument. Example: >
526 526
527 :call AntSyntaxScript('perl', 'perl.vim') 527 :call AntSyntaxScript('perl', 'perl.vim')
528 528
529 will install syntax perl highlighting for the following ant code > 529 will install syntax perl highlighting for the following ant code >
530 530
735 :unlet cobol_legacy_code 735 :unlet cobol_legacy_code
736 736
737 737
738 COLD FUSION *coldfusion.vim* *coldfusion-syntax* 738 COLD FUSION *coldfusion.vim* *coldfusion-syntax*
739 739
740 The ColdFusion has its own version of HTML comments. To turn on ColdFusion 740 The ColdFusion has its own version of HTML comments. To turn on ColdFusion
741 comment highlighting, add the following line to your startup file: > 741 comment highlighting, add the following line to your startup file: >
742 742
743 :let html_wrong_comments = 1 743 :let html_wrong_comments = 1
744 744
745 The ColdFusion syntax file is based on the HTML syntax file. 745 The ColdFusion syntax file is based on the HTML syntax file.
761 761
762 :let filetype_csh = "tcsh" 762 :let filetype_csh = "tcsh"
763 763
764 Any script with a tcsh extension or a standard tcsh filename (.tcshrc, 764 Any script with a tcsh extension or a standard tcsh filename (.tcshrc,
765 tcsh.tcshrc, tcsh.login) will have filetype tcsh. All other tcsh/csh scripts 765 tcsh.tcshrc, tcsh.login) will have filetype tcsh. All other tcsh/csh scripts
766 will be classified as tcsh, UNLESS the "filetype_csh" variable exists. If the 766 will be classified as tcsh, UNLESS the "filetype_csh" variable exists. If the
767 "filetype_csh" variable exists, the filetype will be set to the value of the 767 "filetype_csh" variable exists, the filetype will be set to the value of the
768 variable. 768 variable.
769 769
770 770
771 CYNLIB *cynlib.vim* *cynlib-syntax* 771 CYNLIB *cynlib.vim* *cynlib-syntax*
772 772
773 Cynlib files are C++ files that use the Cynlib class library to enable 773 Cynlib files are C++ files that use the Cynlib class library to enable
774 hardware modelling and simulation using C++. Typically Cynlib files have a .cc 774 hardware modelling and simulation using C++. Typically Cynlib files have a .cc
775 or a .cpp extension, which makes it very difficult to distinguish them from a 775 or a .cpp extension, which makes it very difficult to distinguish them from a
776 normal C++ file. Thus, to enable Cynlib highlighting for .cc files, add this 776 normal C++ file. Thus, to enable Cynlib highlighting for .cc files, add this
777 line to your .vimrc file: > 777 line to your .vimrc file: >
778 778
779 :let cynlib_cyntax_for_cc=1 779 :let cynlib_cyntax_for_cc=1
780 780
781 Similarly for cpp files (this extension is only usually used in Windows) > 781 Similarly for cpp files (this extension is only usually used in Windows) >
799 DESKTOP *desktop.vim* *desktop-syntax* 799 DESKTOP *desktop.vim* *desktop-syntax*
800 800
801 Primary goal of this syntax file is to highlight .desktop and .directory files 801 Primary goal of this syntax file is to highlight .desktop and .directory files
802 according to freedesktop.org standard: http://pdx.freedesktop.org/Standards/ 802 according to freedesktop.org standard: http://pdx.freedesktop.org/Standards/
803 But actually almost none implements this standard fully. Thus it will 803 But actually almost none implements this standard fully. Thus it will
804 highlight all Unix ini files. But you can force strict highlighting according 804 highlight all Unix ini files. But you can force strict highlighting according
805 to standard by placing this in your vimrc file: > 805 to standard by placing this in your vimrc file: >
806 :let enforce_freedesktop_standard = 1 806 :let enforce_freedesktop_standard = 1
807 807
808 808
809 DIRCOLORS *dircolors.vim* *dircolors-syntax* 809 DIRCOLORS *dircolors.vim* *dircolors-syntax*
848 848
849 If this variable is not defined it defaults to a value of 2 to support 849 If this variable is not defined it defaults to a value of 2 to support
850 Windows 2000. 850 Windows 2000.
851 851
852 A second option covers whether *.btm files should be detected as type 852 A second option covers whether *.btm files should be detected as type
853 "dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter 853 "dosbatch" (MS-DOS batch files) or type "btm" (4DOS batch files). The latter
854 is used by default. You may select the former with the following line: > 854 is used by default. You may select the former with the following line: >
855 855
856 :let g:dosbatch_syntax_for_btm = 1 856 :let g:dosbatch_syntax_for_btm = 1
857 857
858 If this variable is undefined or zero, btm syntax is selected. 858 If this variable is undefined or zero, btm syntax is selected.
859 859
860 860
861 861
862 DTD *dtd.vim* *dtd-syntax* 862 DTD *dtd.vim* *dtd-syntax*
863 863
864 The DTD syntax highlighting is case sensitive by default. To disable 864 The DTD syntax highlighting is case sensitive by default. To disable
865 case-sensitive highlighting, add the following line to your startup file: > 865 case-sensitive highlighting, add the following line to your startup file: >
866 866
867 :let dtd_ignore_case=1 867 :let dtd_ignore_case=1
868 868
869 The DTD syntax file will highlight unknown tags as errors. If 869 The DTD syntax file will highlight unknown tags as errors. If
870 this is annoying, it can be turned off by setting: > 870 this is annoying, it can be turned off by setting: >
871 871
872 :let dtd_no_tag_errors=1 872 :let dtd_no_tag_errors=1
873 873
874 before sourcing the dtd.vim syntax file. 874 before sourcing the dtd.vim syntax file.
875 Parameter entity names are highlighted in the definition using the 875 Parameter entity names are highlighted in the definition using the
876 'Type' highlighting group and 'Comment' for punctuation and '%'. 876 'Type' highlighting group and 'Comment' for punctuation and '%'.
877 Parameter entity instances are highlighted using the 'Constant' 877 Parameter entity instances are highlighted using the 'Constant'
878 highlighting group and the 'Type' highlighting group for the 878 highlighting group and the 'Type' highlighting group for the
879 delimiters % and ;. This can be turned off by setting: > 879 delimiters % and ;. This can be turned off by setting: >
880 880
881 :let dtd_no_param_entities=1 881 :let dtd_no_param_entities=1
882 882
883 The DTD syntax file is also included by xml.vim to highlight included dtd's. 883 The DTD syntax file is also included by xml.vim to highlight included dtd's.
884 884
885 885
886 EIFFEL *eiffel.vim* *eiffel-syntax* 886 EIFFEL *eiffel.vim* *eiffel-syntax*
887 887
888 While Eiffel is not case-sensitive, its style guidelines are, and the 888 While Eiffel is not case-sensitive, its style guidelines are, and the
889 syntax highlighting file encourages their use. This also allows to 889 syntax highlighting file encourages their use. This also allows to
890 highlight class names differently. If you want to disable case-sensitive 890 highlight class names differently. If you want to disable case-sensitive
891 highlighting, add the following line to your startup file: > 891 highlighting, add the following line to your startup file: >
892 892
893 :let eiffel_ignore_case=1 893 :let eiffel_ignore_case=1
894 894
895 Case still matters for class names and TODO marks in comments. 895 Case still matters for class names and TODO marks in comments.
917 Support for ISE's proposed new creation syntax that is already 917 Support for ISE's proposed new creation syntax that is already
918 experimentally handled by some compilers can be enabled by: > 918 experimentally handled by some compilers can be enabled by: >
919 919
920 :let eiffel_ise=1 920 :let eiffel_ise=1
921 921
922 Finally, some vendors support hexadecimal constants. To handle them, add > 922 Finally, some vendors support hexadecimal constants. To handle them, add >
923 923
924 :let eiffel_hex_constants=1 924 :let eiffel_hex_constants=1
925 925
926 to your startup file. 926 to your startup file.
927 927
963 963
964 Note that the form.vim syntax file implements FORM preprocessor commands and 964 Note that the form.vim syntax file implements FORM preprocessor commands and
965 directives per default in the same syntax group. 965 directives per default in the same syntax group.
966 966
967 A predefined enhanced color mode for FORM is available to distinguish between 967 A predefined enhanced color mode for FORM is available to distinguish between
968 header statements and statements in the body of a FORM program. To activate 968 header statements and statements in the body of a FORM program. To activate
969 this mode define the following variable in your vimrc file > 969 this mode define the following variable in your vimrc file >
970 970
971 :let form_enhanced_color=1 971 :let form_enhanced_color=1
972 972
973 The enhanced mode also takes advantage of additional color features for a dark 973 The enhanced mode also takes advantage of additional color features for a dark
974 gvim display. Here, statements are colored LightYellow instead of Yellow, and 974 gvim display. Here, statements are colored LightYellow instead of Yellow, and
975 conditionals are LightBlue for better distinction. 975 conditionals are LightBlue for better distinction.
976 976
977 977
978 FORTRAN *fortran.vim* *fortran-syntax* 978 FORTRAN *fortran.vim* *fortran-syntax*
979 979
980 Default highlighting and dialect ~ 980 Default highlighting and dialect ~
981 Highlighting appropriate for f95 (Fortran 95) is used by default. This choice 981 Highlighting appropriate for f95 (Fortran 95) is used by default. This choice
982 should be appropriate for most users most of the time because Fortran 95 is a 982 should be appropriate for most users most of the time because Fortran 95 is a
983 superset of Fortran 90 and almost a superset of Fortran 77. 983 superset of Fortran 90 and almost a superset of Fortran 77.
984 984
985 Fortran source code form ~ 985 Fortran source code form ~
986 Fortran 9x code can be in either fixed or free source form. Note that the 986 Fortran 9x code can be in either fixed or free source form. Note that the
987 syntax highlighting will not be correct if the form is incorrectly set. 987 syntax highlighting will not be correct if the form is incorrectly set.
988 988
989 When you create a new fortran file, the syntax script assumes fixed source 989 When you create a new fortran file, the syntax script assumes fixed source
990 form. If you always use free source form, then > 990 form. If you always use free source form, then >
991 :let fortran_free_source=1 991 :let fortran_free_source=1
992 in your .vimrc prior to the :syntax on command. If you always use fixed source 992 in your .vimrc prior to the :syntax on command. If you always use fixed source
993 form, then > 993 form, then >
994 :let fortran_fixed_source=1 994 :let fortran_fixed_source=1
995 in your .vimrc prior to the :syntax on command. 995 in your .vimrc prior to the :syntax on command.
996 996
997 If the form of the source code depends upon the file extension, then it is 997 If the form of the source code depends upon the file extension, then it is
998 most convenient to set fortran_free_source in a ftplugin file. For more 998 most convenient to set fortran_free_source in a ftplugin file. For more
999 information on ftplugin files, see |ftplugin|. For example, if all your 999 information on ftplugin files, see |ftplugin|. For example, if all your
1000 fortran files with an .f90 extension are written in free source form and the 1000 fortran files with an .f90 extension are written in free source form and the
1001 rest in fixed source form, add the following code to your ftplugin file > 1001 rest in fixed source form, add the following code to your ftplugin file >
1002 let s:extfname = expand("%:e") 1002 let s:extfname = expand("%:e")
1003 if s:extfname ==? "f90" 1003 if s:extfname ==? "f90"
1004 let fortran_free_source=1 1004 let fortran_free_source=1
1010 Note that this will work only if the "filetype plugin indent on" command 1010 Note that this will work only if the "filetype plugin indent on" command
1011 precedes the "syntax on" command in your .vimrc file. 1011 precedes the "syntax on" command in your .vimrc file.
1012 1012
1013 When you edit an existing fortran file, the syntax script will assume free 1013 When you edit an existing fortran file, the syntax script will assume free
1014 source form if the fortran_free_source variable has been set, and assumes 1014 source form if the fortran_free_source variable has been set, and assumes
1015 fixed source form if the fortran_fixed_source variable has been set. If 1015 fixed source form if the fortran_fixed_source variable has been set. If
1016 neither of these variables have been set, the syntax script attempts to 1016 neither of these variables have been set, the syntax script attempts to
1017 determine which source form has been used by examining the first five columns 1017 determine which source form has been used by examining the first five columns
1018 of the first 25 lines of your file. If no signs of free source form are 1018 of the first 25 lines of your file. If no signs of free source form are
1019 detected, then the file is assumed to be in fixed source form. The algorithm 1019 detected, then the file is assumed to be in fixed source form. The algorithm
1020 should work in the vast majority of cases. In some cases, such as a file that 1020 should work in the vast majority of cases. In some cases, such as a file that
1021 begins with 25 or more full-line comments, the script may incorrectly decide 1021 begins with 25 or more full-line comments, the script may incorrectly decide
1022 that the fortran code is in fixed form. If that happens, just add a 1022 that the fortran code is in fixed form. If that happens, just add a
1023 non-comment statement beginning anywhere in the first five columns of the 1023 non-comment statement beginning anywhere in the first five columns of the
1024 first twenty five lines, save (:w) and then reload (:e!) the file. 1024 first twenty five lines, save (:w) and then reload (:e!) the file.
1025 1025
1026 Tabs in fortran files ~ 1026 Tabs in fortran files ~
1027 Tabs are not recognized by the Fortran standards. Tabs are not a good idea in 1027 Tabs are not recognized by the Fortran standards. Tabs are not a good idea in
1028 fixed format fortran source code which requires fixed column boundaries. 1028 fixed format fortran source code which requires fixed column boundaries.
1029 Therefore, tabs are marked as errors. Nevertheless, some programmers like 1029 Therefore, tabs are marked as errors. Nevertheless, some programmers like
1030 using tabs. If your fortran files contain tabs, then you should set the 1030 using tabs. If your fortran files contain tabs, then you should set the
1031 variable fortran_have_tabs in your .vimrc with a command such as > 1031 variable fortran_have_tabs in your .vimrc with a command such as >
1032 :let fortran_have_tabs=1 1032 :let fortran_have_tabs=1
1033 placed prior to the :syntax on command. Unfortunately, the use of tabs will 1033 placed prior to the :syntax on command. Unfortunately, the use of tabs will
1034 mean that the syntax file will not be able to detect incorrect margins. 1034 mean that the syntax file will not be able to detect incorrect margins.
1035 1035
1036 Syntax folding of fortran files ~ 1036 Syntax folding of fortran files ~
1037 If you wish to use foldmethod=syntax, then you must first set the variable 1037 If you wish to use foldmethod=syntax, then you must first set the variable
1038 fortran_fold with a command such as > 1038 fortran_fold with a command such as >
1039 :let fortran_fold=1 1039 :let fortran_fold=1
1040 to instruct the syntax script to define fold regions for program units, that 1040 to instruct the syntax script to define fold regions for program units, that
1041 is main programs starting with a program statement, subroutines, function 1041 is main programs starting with a program statement, subroutines, function
1042 subprograms, block data subprograms, interface blocks, and modules. If you 1042 subprograms, block data subprograms, interface blocks, and modules. If you
1043 also set the variable fortran_fold_conditionals with a command such as > 1043 also set the variable fortran_fold_conditionals with a command such as >
1044 :let fortran_fold_conditionals=1 1044 :let fortran_fold_conditionals=1
1045 then fold regions will also be defined for do loops, if blocks, and select 1045 then fold regions will also be defined for do loops, if blocks, and select
1046 case constructs. If you also set the variable 1046 case constructs. If you also set the variable
1047 fortran_fold_multilinecomments with a command such as > 1047 fortran_fold_multilinecomments with a command such as >
1048 :let fortran_fold_multilinecomments=1 1048 :let fortran_fold_multilinecomments=1
1049 then fold regions will also be defined for three or more consecutive comment 1049 then fold regions will also be defined for three or more consecutive comment
1050 lines. Note that defining fold regions can be slow for large files. 1050 lines. Note that defining fold regions can be slow for large files.
1051 1051
1052 If fortran_fold, and possibly fortran_fold_conditionals and/or 1052 If fortran_fold, and possibly fortran_fold_conditionals and/or
1053 fortran_fold_multilinecomments, have been set, then vim will fold your file if 1053 fortran_fold_multilinecomments, have been set, then vim will fold your file if
1054 you set foldmethod=syntax. Comments or blank lines placed between two program 1054 you set foldmethod=syntax. Comments or blank lines placed between two program
1055 units are not folded because they are seen as not belonging to any program 1055 units are not folded because they are seen as not belonging to any program
1056 unit. 1056 unit.
1057 1057
1058 More precise fortran syntax ~ 1058 More precise fortran syntax ~
1059 If you set the variable fortran_more_precise with a command such as > 1059 If you set the variable fortran_more_precise with a command such as >
1060 :let fortran_more_precise=1 1060 :let fortran_more_precise=1
1061 then the syntax coloring will be more precise but slower. In particular, 1061 then the syntax coloring will be more precise but slower. In particular,
1062 statement labels used in do, goto and arithmetic if statements will be 1062 statement labels used in do, goto and arithmetic if statements will be
1063 recognized, as will construct names at the end of a do, if, select or forall 1063 recognized, as will construct names at the end of a do, if, select or forall
1064 construct. 1064 construct.
1065 1065
1066 Non-default fortran dialects ~ 1066 Non-default fortran dialects ~
1068 subset elf90, and the Imagine1 subset F. 1068 subset elf90, and the Imagine1 subset F.
1069 1069
1070 If you use f77 with extensions, even common ones like do/enddo loops, do/while 1070 If you use f77 with extensions, even common ones like do/enddo loops, do/while
1071 loops and free source form that are supported by most f77 compilers including 1071 loops and free source form that are supported by most f77 compilers including
1072 g77 (GNU Fortran), then you will probably find the default highlighting 1072 g77 (GNU Fortran), then you will probably find the default highlighting
1073 satisfactory. However, if you use strict f77 with no extensions, not even free 1073 satisfactory. However, if you use strict f77 with no extensions, not even free
1074 source form or the MIL STD 1753 extensions, then the advantages of setting the 1074 source form or the MIL STD 1753 extensions, then the advantages of setting the
1075 dialect to f77 are that names such as SUM are recognized as user variable 1075 dialect to f77 are that names such as SUM are recognized as user variable
1076 names and not highlighted as f9x intrinsic functions, that obsolete constructs 1076 names and not highlighted as f9x intrinsic functions, that obsolete constructs
1077 such as ASSIGN statements are not highlighted as todo items, and that fixed 1077 such as ASSIGN statements are not highlighted as todo items, and that fixed
1078 source form will be assumed. 1078 source form will be assumed.
1080 If you use elf90 or F, the advantage of setting the dialect appropriately is 1080 If you use elf90 or F, the advantage of setting the dialect appropriately is
1081 that f90 features excluded from these dialects will be highlighted as todo 1081 that f90 features excluded from these dialects will be highlighted as todo
1082 items and that free source form will be assumed as required for these 1082 items and that free source form will be assumed as required for these
1083 dialects. 1083 dialects.
1084 1084
1085 The dialect can be selected by setting the variable fortran_dialect. The 1085 The dialect can be selected by setting the variable fortran_dialect. The
1086 permissible values of fortran_dialect are case-sensitive and must be "f95", 1086 permissible values of fortran_dialect are case-sensitive and must be "f95",
1087 "f90", "f77", "elf" or "F". Invalid values of fortran_dialect are ignored. 1087 "f90", "f77", "elf" or "F". Invalid values of fortran_dialect are ignored.
1088 1088
1089 If all your fortran files use the same dialect, set fortran_dialect in your 1089 If all your fortran files use the same dialect, set fortran_dialect in your
1090 .vimrc prior to your syntax on statement. If the dialect depends upon the file 1090 .vimrc prior to your syntax on statement. If the dialect depends upon the file
1091 extension, then it is most convenient to set it in a ftplugin file. For more 1091 extension, then it is most convenient to set it in a ftplugin file. For more
1092 information on ftplugin files, see |ftplugin|. For example, if all your 1092 information on ftplugin files, see |ftplugin|. For example, if all your
1093 fortran files with an .f90 extension are written in the elf subset, your 1093 fortran files with an .f90 extension are written in the elf subset, your
1094 ftplugin file should contain the code > 1094 ftplugin file should contain the code >
1095 let s:extfname = expand("%:e") 1095 let s:extfname = expand("%:e")
1096 if s:extfname ==? "f90" 1096 if s:extfname ==? "f90"
1097 let fortran_dialect="elf" 1097 let fortran_dialect="elf"
1100 endif 1100 endif
1101 Note that this will work only if the "filetype plugin indent on" command 1101 Note that this will work only if the "filetype plugin indent on" command
1102 precedes the "syntax on" command in your .vimrc file. 1102 precedes the "syntax on" command in your .vimrc file.
1103 1103
1104 Finer control is necessary if the file extension does not uniquely identify 1104 Finer control is necessary if the file extension does not uniquely identify
1105 the dialect. You can override the default dialect, on a file-by-file basis, by 1105 the dialect. You can override the default dialect, on a file-by-file basis, by
1106 including a comment with the directive "fortran_dialect=xx" (where xx=f77 or 1106 including a comment with the directive "fortran_dialect=xx" (where xx=f77 or
1107 elf or F or f90 or f95) in one of the first three lines in your file. For 1107 elf or F or f90 or f95) in one of the first three lines in your file. For
1108 example, your older .f files may be written in extended f77 but your newer 1108 example, your older .f files may be written in extended f77 but your newer
1109 ones may be F codes, and you would identify the latter by including in the 1109 ones may be F codes, and you would identify the latter by including in the
1110 first three lines of those files a Fortran comment of the form > 1110 first three lines of those files a Fortran comment of the form >
1111 ! fortran_dialect=F 1111 ! fortran_dialect=F
1112 F overrides elf if both directives are present. 1112 F overrides elf if both directives are present.
1113 1113
1114 Limitations ~ 1114 Limitations ~
1115 Parenthesis checking does not catch too few closing parentheses. Hollerith 1115 Parenthesis checking does not catch too few closing parentheses. Hollerith
1116 strings are not recognized. Some keywords may be highlighted incorrectly 1116 strings are not recognized. Some keywords may be highlighted incorrectly
1117 because Fortran90 has no reserved words. 1117 because Fortran90 has no reserved words.
1118 1118
1119 For further information related to fortran, see |fortran-indent| and 1119 For further information related to fortran, see |fortran-indent| and
1120 |fortran-plugin|. 1120 |fortran-plugin|.
1121 1121
1168 1168
1169 1169
1170 GROFF *groff.vim* *groff-syntax* 1170 GROFF *groff.vim* *groff-syntax*
1171 1171
1172 The groff syntax file is a wrapper for |nroff.vim|, see the notes 1172 The groff syntax file is a wrapper for |nroff.vim|, see the notes
1173 under that heading for examples of use and configuration. The purpose 1173 under that heading for examples of use and configuration. The purpose
1174 of this wrapper is to set up groff syntax extensions by setting the 1174 of this wrapper is to set up groff syntax extensions by setting the
1175 filetype from a |modeline| or in a personal filetype definitions file 1175 filetype from a |modeline| or in a personal filetype definitions file
1176 (see |filetype.txt|). 1176 (see |filetype.txt|).
1177 1177
1178 1178
1179 HASKELL *haskell.vim* *lhaskell.vim* *haskell-syntax* 1179 HASKELL *haskell.vim* *lhaskell.vim* *haskell-syntax*
1180 1180
1181 The Haskell syntax files support plain Haskell code as well as literate 1181 The Haskell syntax files support plain Haskell code as well as literate
1182 Haskell code, the latter in both Bird style and TeX style. The Haskell 1182 Haskell code, the latter in both Bird style and TeX style. The Haskell
1183 syntax highlighting will also highlight C preprocessor directives. 1183 syntax highlighting will also highlight C preprocessor directives.
1184 1184
1185 If you want to highlight delimiter characters (useful if you have a 1185 If you want to highlight delimiter characters (useful if you have a
1186 light-coloured background), add to your .vimrc: > 1186 light-coloured background), add to your .vimrc: >
1187 :let hs_highlight_delimiters = 1 1187 :let hs_highlight_delimiters = 1
1196 your .vimrc: > 1196 your .vimrc: >
1197 :let hs_highlight_debug = 1 1197 :let hs_highlight_debug = 1
1198 1198
1199 The Haskell syntax highlighting also highlights C preprocessor 1199 The Haskell syntax highlighting also highlights C preprocessor
1200 directives, and flags lines that start with # but are not valid 1200 directives, and flags lines that start with # but are not valid
1201 directives as erroneous. This interferes with Haskell's syntax for 1201 directives as erroneous. This interferes with Haskell's syntax for
1202 operators, as they may start with #. If you want to highlight those 1202 operators, as they may start with #. If you want to highlight those
1203 as operators as opposed to errors, put in your .vimrc: > 1203 as operators as opposed to errors, put in your .vimrc: >
1204 :let hs_allow_hash_operator = 1 1204 :let hs_allow_hash_operator = 1
1205 1205
1206 The syntax highlighting for literate Haskell code will try to 1206 The syntax highlighting for literate Haskell code will try to
1207 automatically guess whether your literate Haskell code contains 1207 automatically guess whether your literate Haskell code contains
1208 TeX markup or not, and correspondingly highlight TeX constructs 1208 TeX markup or not, and correspondingly highlight TeX constructs
1209 or nothing at all. You can override this globally by putting 1209 or nothing at all. You can override this globally by putting
1210 in your .vimrc > 1210 in your .vimrc >
1211 :let lhs_markup = none 1211 :let lhs_markup = none
1212 for no highlighting at all, or > 1212 for no highlighting at all, or >
1213 :let lhs_markup = tex 1213 :let lhs_markup = tex
1214 to force the highlighting to always try to highlight TeX markup. 1214 to force the highlighting to always try to highlight TeX markup.
1215 For more flexibility, you may also use buffer local versions of 1215 For more flexibility, you may also use buffer local versions of
1216 this variable, so e.g. > 1216 this variable, so e.g. >
1217 :let b:lhs_markup = tex 1217 :let b:lhs_markup = tex
1218 will force TeX highlighting for a particular buffer. It has to be 1218 will force TeX highlighting for a particular buffer. It has to be
1219 set before turning syntax highlighting on for the buffer or 1219 set before turning syntax highlighting on for the buffer or
1220 loading a file. 1220 loading a file.
1221 1221
1222 1222
1223 HTML *html.vim* *html-syntax* 1223 HTML *html.vim* *html-syntax*
1231 1231
1232 Known tag names are colored the same way as statements in C. Unknown tag 1232 Known tag names are colored the same way as statements in C. Unknown tag
1233 names are colored with the same color as the <> or </> respectively which 1233 names are colored with the same color as the <> or </> respectively which
1234 makes it easy to spot errors 1234 makes it easy to spot errors
1235 1235
1236 Note that the same is true for argument (or attribute) names. Known attribute 1236 Note that the same is true for argument (or attribute) names. Known attribute
1237 names are colored differently than unknown ones. 1237 names are colored differently than unknown ones.
1238 1238
1239 Some HTML tags are used to change the rendering of text. The following tags 1239 Some HTML tags are used to change the rendering of text. The following tags
1240 are recognized by the html.vim syntax coloring file and change the way normal 1240 are recognized by the html.vim syntax coloring file and change the way normal
1241 text is shown: <B> <I> <U> <EM> <STRONG> (<EM> is used as an alias for <I>, 1241 text is shown: <B> <I> <U> <EM> <STRONG> (<EM> is used as an alias for <I>,
1242 while <STRONG> as an alias for <B>), <H1> - <H6>, <HEAD>, <TITLE> and <A>, but 1242 while <STRONG> as an alias for <B>), <H1> - <H6>, <HEAD>, <TITLE> and <A>, but
1243 only if used as a link that is, it must include a href as in 1243 only if used as a link (that is, it must include a href as in
1244 <A href="somfile.html">). 1244 <A href="somfile.html">).
1245 1245
1246 If you want to change how such text is rendered, you must redefine the 1246 If you want to change how such text is rendered, you must redefine the
1247 following syntax groups: 1247 following syntax groups:
1248 1248
1274 ends with --!>) you can define > 1274 ends with --!>) you can define >
1275 :let html_wrong_comments=1 1275 :let html_wrong_comments=1
1276 1276
1277 JavaScript and Visual Basic embedded inside HTML documents are highlighted as 1277 JavaScript and Visual Basic embedded inside HTML documents are highlighted as
1278 'Special' with statements, comments, strings and so on colored as in standard 1278 'Special' with statements, comments, strings and so on colored as in standard
1279 programming languages. Note that only JavaScript and Visual Basic are currently 1279 programming languages. Note that only JavaScript and Visual Basic are currently
1280 supported, no other scripting language has been added yet. 1280 supported, no other scripting language has been added yet.
1281 1281
1282 Embedded and inlined cascading style sheets (CSS) are highlighted too. 1282 Embedded and inlined cascading style sheets (CSS) are highlighted too.
1283 1283
1284 There are several html preprocessor languages out there. html.vim has been 1284 There are several html preprocessor languages out there. html.vim has been
1285 written such that it should be trivial to include it. To do so add the 1285 written such that it should be trivial to include it. To do so add the
1286 following two lines to the syntax coloring file for that language 1286 following two lines to the syntax coloring file for that language
1287 (the example comes from the asp.vim file): 1287 (the example comes from the asp.vim file):
1288 1288
1289 runtime! syntax/html.vim 1289 runtime! syntax/html.vim
1290 syn cluster htmlPreproc add=asp 1290 syn cluster htmlPreproc add=asp
1356 1356
1357 The java.vim syntax highlighting file offers several options: 1357 The java.vim syntax highlighting file offers several options:
1358 1358
1359 In Java 1.0.2 it was never possible to have braces inside parens, so this was 1359 In Java 1.0.2 it was never possible to have braces inside parens, so this was
1360 flagged as an error. Since Java 1.1 this is possible (with anonymous 1360 flagged as an error. Since Java 1.1 this is possible (with anonymous
1361 classes), and therefore is no longer marked as an error. If you prefer the old 1361 classes), and therefore is no longer marked as an error. If you prefer the old
1362 way, put the following line into your vim startup file: > 1362 way, put the following line into your vim startup file: >
1363 :let java_mark_braces_in_parens_as_errors=1 1363 :let java_mark_braces_in_parens_as_errors=1
1364 1364
1365 All identifiers in java.lang.* are always visible in all classes. To 1365 All identifiers in java.lang.* are always visible in all classes. To
1366 highlight them use: > 1366 highlight them use: >
1367 :let java_highlight_java_lang_ids=1 1367 :let java_highlight_java_lang_ids=1
1368 1368
1369 You can also highlight identifiers of most standard java packages if you 1369 You can also highlight identifiers of most standard Java packages if you
1370 download the javaid.vim script at http://www.fleiner.com/vim/download.html. 1370 download the javaid.vim script at http://www.fleiner.com/vim/download.html.
1371 If you prefer to only highlight identifiers of a certain package, say java.io 1371 If you prefer to only highlight identifiers of a certain package, say java.io
1372 use the following: > 1372 use the following: >
1373 :let java_highlight_java_io=1 1373 :let java_highlight_java_io=1
1374 Check the javaid.vim file for a list of all the packages that are supported. 1374 Check the javaid.vim file for a list of all the packages that are supported.
1375 1375
1376 Function names are not highlighted, as the way to find functions depends on 1376 Function names are not highlighted, as the way to find functions depends on
1377 how you write java code. The syntax file knows two possible ways to highlight 1377 how you write Java code. The syntax file knows two possible ways to highlight
1378 functions: 1378 functions:
1379 1379
1380 If you write function declarations that are always indented by either 1380 If you write function declarations that are always indented by either
1381 a tab, 8 spaces or 2 spaces you may want to set > 1381 a tab, 8 spaces or 2 spaces you may want to set >
1382 :let java_highlight_functions="indent" 1382 :let java_highlight_functions="indent"
1386 If both options do not work for you, but you would still want function 1386 If both options do not work for you, but you would still want function
1387 declarations to be highlighted create your own definitions by changing the 1387 declarations to be highlighted create your own definitions by changing the
1388 definitions in java.vim or by creating your own java.vim which includes the 1388 definitions in java.vim or by creating your own java.vim which includes the
1389 original one and then adds the code to highlight functions. 1389 original one and then adds the code to highlight functions.
1390 1390
1391 In java 1.1 the functions System.out.println() and System.err.println() should 1391 In Java 1.1 the functions System.out.println() and System.err.println() should
1392 only be used for debugging. Therefore it is possible to highlight debugging 1392 only be used for debugging. Therefore it is possible to highlight debugging
1393 statements differently. To do this you must add the following definition in 1393 statements differently. To do this you must add the following definition in
1394 your startup file: > 1394 your startup file: >
1395 :let java_highlight_debug=1 1395 :let java_highlight_debug=1
1396 The result will be that those statements are highlighted as 'Special' 1396 The result will be that those statements are highlighted as 'Special'
1397 characters. If you prefer to have them highlighted differently you must define 1397 characters. If you prefer to have them highlighted differently you must define
1398 new highlightings for the following groups.: 1398 new highlightings for the following groups.:
1399 Debug, DebugSpecial, DebugString, DebugBoolean, DebugType 1399 Debug, DebugSpecial, DebugString, DebugBoolean, DebugType
1400 which are used for the statement itself, special characters used in debug 1400 which are used for the statement itself, special characters used in debug
1401 strings, strings, boolean constants and types (this, super) respectively. I 1401 strings, strings, boolean constants and types (this, super) respectively. I
1402 have opted to chose another background for those statements. 1402 have opted to chose another background for those statements.
1403 1403
1404 In order to help you to write code that can be easily ported between 1404 In order to help you to write code that can be easily ported between
1405 java and C++, all C++ keywords are marked as error in a java program. 1405 Java and C++, all C++ keywords are marked as error in a Java program.
1406 However, if you use them regularly, you may want to define the following 1406 However, if you use them regularly, you may want to define the following
1407 variable in your .vimrc file: > 1407 variable in your .vimrc file: >
1408 :let java_allow_cpp_keywords=1 1408 :let java_allow_cpp_keywords=1
1409 1409
1410 Javadoc is a program that takes special comments out of java program files and 1410 Javadoc is a program that takes special comments out of Java program files and
1411 creates HTML pages. The standard configuration will highlight this HTML code 1411 creates HTML pages. The standard configuration will highlight this HTML code
1412 similarly to HTML files (see |html.vim|). You can even add javascript 1412 similarly to HTML files (see |html.vim|). You can even add Javascript
1413 and CSS inside this code (see below). There are four differences however: 1413 and CSS inside this code (see below). There are four differences however:
1414 1. The title (all characters up to the first '.' which is followed by 1414 1. The title (all characters up to the first '.' which is followed by
1415 some white space or up to the first '@') is colored differently (to change 1415 some white space or up to the first '@') is colored differently (to change
1416 the color change the group CommentTitle). 1416 the color change the group CommentTitle).
1417 2. The text is colored as 'Comment'. 1417 2. The text is colored as 'Comment'.
1418 3. HTML comments are colored as 'Special' 1418 3. HTML comments are colored as 'Special'
1419 4. The special javadoc tags (@see, @param, ...) are highlighted as specials 1419 4. The special Javadoc tags (@see, @param, ...) are highlighted as specials
1420 and the argument (for @see, @param, @exception) as Function. 1420 and the argument (for @see, @param, @exception) as Function.
1421 To turn this feature off add the following line to your startup file: > 1421 To turn this feature off add the following line to your startup file: >
1422 :let java_ignore_javadoc=1 1422 :let java_ignore_javadoc=1
1423 1423
1424 If you use the special javadoc comment highlighting described above you 1424 If you use the special Javadoc comment highlighting described above you
1425 can also turn on special highlighting for javascript, visual basic 1425 can also turn on special highlighting for Javascript, visual basic
1426 scripts and embedded CSS (stylesheets). This makes only sense if you 1426 scripts and embedded CSS (stylesheets). This makes only sense if you
1427 actually have javadoc comments that include either javascript or embedded 1427 actually have Javadoc comments that include either Javascript or embedded
1428 CSS. The options to use are > 1428 CSS. The options to use are >
1429 :let java_javascript=1 1429 :let java_javascript=1
1430 :let java_css=1 1430 :let java_css=1
1431 :let java_vb=1 1431 :let java_vb=1
1432 1432
1433 In order to highlight nested parens with different colors define colors 1433 In order to highlight nested parens with different colors define colors
1476 :let lite_minlines = 200 1476 :let lite_minlines = 200
1477 1477
1478 1478
1479 LPC *lpc.vim* *lpc-syntax* 1479 LPC *lpc.vim* *lpc-syntax*
1480 1480
1481 LPC stands for a simple, memory-efficient language: Lars Pensj| C. The 1481 LPC stands for a simple, memory-efficient language: Lars Pensj| C. The
1482 file name of LPC is usually *.c. Recognizing these files as LPC would bother 1482 file name of LPC is usually *.c. Recognizing these files as LPC would bother
1483 users writing only C programs. If you want to use LPC syntax in Vim, you 1483 users writing only C programs. If you want to use LPC syntax in Vim, you
1484 should set a variable in your .vimrc file: > 1484 should set a variable in your .vimrc file: >
1485 1485
1486 :let lpc_syntax_for_c = 1 1486 :let lpc_syntax_for_c = 1
1495 // vim:set ft=c: 1495 // vim:set ft=c:
1496 1496
1497 If you don't want to set the variable, use the modeline in EVERY LPC file. 1497 If you don't want to set the variable, use the modeline in EVERY LPC file.
1498 1498
1499 There are several implementations for LPC, we intend to support most widely 1499 There are several implementations for LPC, we intend to support most widely
1500 used ones. Here the default LPC syntax is for MudOS series, for MudOS v22 1500 used ones. Here the default LPC syntax is for MudOS series, for MudOS v22
1501 and before, you should turn off the sensible modifiers, and this will also 1501 and before, you should turn off the sensible modifiers, and this will also
1502 asserts the new efuns after v22 to be invalid, don't set this variable when 1502 asserts the new efuns after v22 to be invalid, don't set this variable when
1503 you are using the latest version of MudOS: > 1503 you are using the latest version of MudOS: >
1504 1504
1505 :let lpc_pre_v22 = 1 1505 :let lpc_pre_v22 = 1
1517 instead, and the name of your source file should be *.pike 1517 instead, and the name of your source file should be *.pike
1518 1518
1519 1519
1520 LUA *lua.vim* *lua-syntax* 1520 LUA *lua.vim* *lua-syntax*
1521 1521
1522 This syntax file may be used for Lua 4.0 and Lua 5.0 (default). If you are 1522 This syntax file may be used for Lua 4.0 and Lua 5.0 (default). If you are
1523 programming in Lua 4.0, use this: > 1523 programming in Lua 4.0, use this: >
1524 1524
1525 :let lua_version = 4 1525 :let lua_version = 4
1526 1526
1527 If lua_version variable doesn't exist, it is set to 5. 1527 If lua_version variable doesn't exist, it is set to 5.
1528 1528
1529 1529
1530 MAIL *mail.vim* 1530 MAIL *mail.vim*
1531 1531
1532 Vim highlights all the standard elements of an email (headers, signatures, 1532 Vim highlights all the standard elements of an email (headers, signatures,
1533 quoted text and URLs / email addresses). In keeping with standard conventions, 1533 quoted text and URLs / email addresses). In keeping with standard conventions,
1534 signatures begin in a line containing only "--" followed optionally by 1534 signatures begin in a line containing only "--" followed optionally by
1535 whitespaces and end with a newline. 1535 whitespaces and end with a newline.
1536 1536
1537 Vim treats lines beginning with ']', '}', '|', '>' or a word followed by '>' 1537 Vim treats lines beginning with ']', '}', '|', '>' or a word followed by '>'
1538 as quoted text. However Vim highlights headers and signatures in quoted text 1538 as quoted text. However Vim highlights headers and signatures in quoted text
1539 only if the text is quoted with '>' (optionally followed by one space). 1539 only if the text is quoted with '>' (optionally followed by one space).
1540 1540
1541 By default mail.vim synchronises syntax to 100 lines before the first 1541 By default mail.vim synchronises syntax to 100 lines before the first
1542 displayed line. If you have a slow machine, and generally deal with emails 1542 displayed line. If you have a slow machine, and generally deal with emails
1543 with short headers, you can change this to a smaller value: > 1543 with short headers, you can change this to a smaller value: >
1544 1544
1545 :let mail_minlines = 30 1545 :let mail_minlines = 30
1546 1546
1547 1547
1602 1602
1603 To highlight builtin properties (.name, .location, .programmer etc.): > 1603 To highlight builtin properties (.name, .location, .programmer etc.): >
1604 1604
1605 :let moo_builtin_properties = 1 1605 :let moo_builtin_properties = 1
1606 1606
1607 Unknown builtin functions can be recognized and highlighted as errors. If you 1607 Unknown builtin functions can be recognized and highlighted as errors. If you
1608 use this option, add your own extensions to the mooKnownBuiltinFunction group. 1608 use this option, add your own extensions to the mooKnownBuiltinFunction group.
1609 To enable this option: > 1609 To enable this option: >
1610 1610
1611 :let moo_unknown_builtin_functions = 1 1611 :let moo_unknown_builtin_functions = 1
1612 1612
1646 The nroff syntax file works with AT&T n/troff out of the box. You need to 1646 The nroff syntax file works with AT&T n/troff out of the box. You need to
1647 activate the GNU groff extra features included in the syntax file before you 1647 activate the GNU groff extra features included in the syntax file before you
1648 can use them. 1648 can use them.
1649 1649
1650 For example, Linux and BSD distributions use groff as their default text 1650 For example, Linux and BSD distributions use groff as their default text
1651 processing package. In order to activate the extra syntax highlighting 1651 processing package. In order to activate the extra syntax highlighting
1652 features for groff, add the following option to your start-up files: > 1652 features for groff, add the following option to your start-up files: >
1653 1653
1654 :let b:nroff_is_groff = 1 1654 :let b:nroff_is_groff = 1
1655 1655
1656 Groff is different from the old AT&T n/troff that you may still find in 1656 Groff is different from the old AT&T n/troff that you may still find in
1657 Solaris. Groff macro and request names can be longer than 2 characters and 1657 Solaris. Groff macro and request names can be longer than 2 characters and
1658 there are extensions to the language primitives. For example, in AT&T troff 1658 there are extensions to the language primitives. For example, in AT&T troff
1659 you access the year as a 2-digit number with the request \(yr. In groff you 1659 you access the year as a 2-digit number with the request \(yr. In groff you
1660 can use the same request, recognized for compatibility, or you can use groff's 1660 can use the same request, recognized for compatibility, or you can use groff's
1661 native syntax, \[yr]. Furthermore, you can use a 4-digit year directly: 1661 native syntax, \[yr]. Furthermore, you can use a 4-digit year directly:
1662 \[year]. Macro requests can be longer than 2 characters, for example, GNU mm 1662 \[year]. Macro requests can be longer than 2 characters, for example, GNU mm
1663 accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim 1663 accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim
1664 environments. 1664 environments.
1682 vertical space input will be output as is. 1682 vertical space input will be output as is.
1683 1683
1684 Therefore, you should be careful about not using more space between sentences 1684 Therefore, you should be careful about not using more space between sentences
1685 than you intend to have in your final document. For this reason, the common 1685 than you intend to have in your final document. For this reason, the common
1686 practice is to insert a carriage return immediately after all punctuation 1686 practice is to insert a carriage return immediately after all punctuation
1687 marks. If you want to have "even" text in your final processed output, you 1687 marks. If you want to have "even" text in your final processed output, you
1688 need to maintaining regular spacing in the input text. To mark both trailing 1688 need to maintaining regular spacing in the input text. To mark both trailing
1689 spaces and two or more spaces after a punctuation as an error, use: > 1689 spaces and two or more spaces after a punctuation as an error, use: >
1690 1690
1691 :let nroff_space_errors = 1 1691 :let nroff_space_errors = 1
1692 1692
1693 Another technique to detect extra spacing and other errors that will interfere 1693 Another technique to detect extra spacing and other errors that will interfere
1694 with the correct typesetting of your file, is to define an eye-catching 1694 with the correct typesetting of your file, is to define an eye-catching
1695 highlighting definition for the syntax groups "nroffDefinition" and 1695 highlighting definition for the syntax groups "nroffDefinition" and
1696 "nroffDefSpecial" in your configuration files. For example: > 1696 "nroffDefSpecial" in your configuration files. For example: >
1697 1697
1698 hi def nroffDefinition term=italic cterm=italic gui=reverse 1698 hi def nroffDefinition term=italic cterm=italic gui=reverse
1699 hi def nroffDefSpecial term=italic,bold cterm=italic,bold 1699 hi def nroffDefSpecial term=italic,bold cterm=italic,bold
1700 \ gui=reverse,bold 1700 \ gui=reverse,bold
1701 1701
1730 1730
1731 PAPP *papp.vim* *papp-syntax* 1731 PAPP *papp.vim* *papp-syntax*
1732 1732
1733 The PApp syntax file handles .papp files and, to a lesser extend, .pxml 1733 The PApp syntax file handles .papp files and, to a lesser extend, .pxml
1734 and .pxsl files which are all a mixture of perl/xml/html/other using xml 1734 and .pxsl files which are all a mixture of perl/xml/html/other using xml
1735 as the top-level file format. By default everything inside phtml or pxml 1735 as the top-level file format. By default everything inside phtml or pxml
1736 sections is treated as a string with embedded preprocessor commands. If 1736 sections is treated as a string with embedded preprocessor commands. If
1737 you set the variable: > 1737 you set the variable: >
1738 1738
1739 :let papp_include_html=1 1739 :let papp_include_html=1
1740 1740
1741 in your startup file it will try to syntax-hilight html code inside phtml 1741 in your startup file it will try to syntax-hilight html code inside phtml
1742 sections, but this is relatively slow and much too colourful to be able to 1742 sections, but this is relatively slow and much too colourful to be able to
1743 edit sensibly ;) 1743 edit sensibly. ;)
1744 1744
1745 The newest version of the papp.vim syntax file can usually be found at 1745 The newest version of the papp.vim syntax file can usually be found at
1746 http://papp.plan9.de. 1746 http://papp.plan9.de.
1747 1747
1748 1748
1754 1754
1755 :let filetype_p = "pascal" 1755 :let filetype_p = "pascal"
1756 1756
1757 The Pascal syntax file has been extended to take into account some extensions 1757 The Pascal syntax file has been extended to take into account some extensions
1758 provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler. 1758 provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler.
1759 Delphi keywords are also supported. By default, Turbo Pascal 7.0 features are 1759 Delphi keywords are also supported. By default, Turbo Pascal 7.0 features are
1760 enabled. If you prefer to stick with the standard Pascal keywords, add the 1760 enabled. If you prefer to stick with the standard Pascal keywords, add the
1761 following line to your startup file: > 1761 following line to your startup file: >
1762 1762
1763 :let pascal_traditional=1 1763 :let pascal_traditional=1
1764 1764
1823 1823
1824 :let perl_no_extended_vars = 1 1824 :let perl_no_extended_vars = 1
1825 1825
1826 (In Vim 6.x it was the other way around: "perl_extended_vars" enabled it.) 1826 (In Vim 6.x it was the other way around: "perl_extended_vars" enabled it.)
1827 1827
1828 The coloring strings can be changed. By default strings and qq friends will be 1828 The coloring strings can be changed. By default strings and qq friends will be
1829 highlighted like the first line. If you set the variable 1829 highlighted like the first line. If you set the variable
1830 perl_string_as_statement, it will be highlighted as in the second line. 1830 perl_string_as_statement, it will be highlighted as in the second line.
1831 1831
1832 "hello world!"; qq|hello world|; 1832 "hello world!"; qq|hello world|;
1833 ^^^^^^^^^^^^^^NN^^^^^^^^^^^^^^^N (unlet perl_string_as_statement) 1833 ^^^^^^^^^^^^^^NN^^^^^^^^^^^^^^^N (unlet perl_string_as_statement)
1834 S^^^^^^^^^^^^SNNSSS^^^^^^^^^^^SN (let perl_string_as_statement) 1834 S^^^^^^^^^^^^SNNSSS^^^^^^^^^^^SN (let perl_string_as_statement)
1835 1835
1836 (^ = perlString, S = perlStatement, N = None at all) 1836 (^ = perlString, S = perlStatement, N = None at all)
1837 1837
1838 The syncing has 3 options. The first two switch off some triggering of 1838 The syncing has 3 options. The first two switch off some triggering of
1839 synchronization and should only be needed in case it fails to work properly. 1839 synchronization and should only be needed in case it fails to work properly.
1840 If while scrolling all of a sudden the whole screen changes color completely 1840 If while scrolling all of a sudden the whole screen changes color completely
1841 then you should try and switch off one of those. Let me know if you can figure 1841 then you should try and switch off one of those. Let me know if you can figure
1842 out the line that causes the mistake. 1842 out the line that causes the mistake.
1843 1843
1844 One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less. > 1844 One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less. >
1845 1845
1846 :let perl_no_sync_on_sub 1846 :let perl_no_sync_on_sub
1918 PPWizard is a preprocessor for HTML and OS/2 INF files 1918 PPWizard is a preprocessor for HTML and OS/2 INF files
1919 1919
1920 This syntax file has the options: 1920 This syntax file has the options:
1921 1921
1922 - ppwiz_highlight_defs : determines highlighting mode for PPWizard's 1922 - ppwiz_highlight_defs : determines highlighting mode for PPWizard's
1923 definitions. Possible values are 1923 definitions. Possible values are
1924 1924
1925 ppwiz_highlight_defs = 1 : PPWizard #define statements retain the 1925 ppwiz_highlight_defs = 1 : PPWizard #define statements retain the
1926 colors of their contents (e. g. PPWizard macros and variables) 1926 colors of their contents (e.g. PPWizard macros and variables)
1927 1927
1928 ppwiz_highlight_defs = 2 : preprocessor #define and #evaluate 1928 ppwiz_highlight_defs = 2 : preprocessor #define and #evaluate
1929 statements are shown in a single color with the exception of line 1929 statements are shown in a single color with the exception of line
1930 continuation symbols 1930 continuation symbols
1931 1931
2064 2064
2065 2065
2066 QUAKE *quake.vim* *quake-syntax* 2066 QUAKE *quake.vim* *quake-syntax*
2067 2067
2068 The Quake syntax definition should work for most any FPS (First Person 2068 The Quake syntax definition should work for most any FPS (First Person
2069 Shooter) based on one of the Quake engines. However, the command names vary 2069 Shooter) based on one of the Quake engines. However, the command names vary
2070 a bit between the three games (Quake, Quake 2, and Quake 3 Arena) so the 2070 a bit between the three games (Quake, Quake 2, and Quake 3 Arena) so the
2071 syntax definition checks for the existence of three global variables to allow 2071 syntax definition checks for the existence of three global variables to allow
2072 users to specify what commands are legal in their files. The three variables 2072 users to specify what commands are legal in their files. The three variables
2073 can be set for the following effects: 2073 can be set for the following effects:
2074 2074
2075 set to highlight commands only available in Quake: > 2075 set to highlight commands only available in Quake: >
2076 :let quake_is_quake1 = 1 2076 :let quake_is_quake1 = 1
2077 2077
2086 2086
2087 2087
2088 READLINE *readline.vim* *readline-syntax* 2088 READLINE *readline.vim* *readline-syntax*
2089 2089
2090 The readline library is primarily used by the BASH shell, which adds quite a 2090 The readline library is primarily used by the BASH shell, which adds quite a
2091 few commands and options to the ones already available. To highlight these 2091 few commands and options to the ones already available. To highlight these
2092 items as well you can add the following to your |vimrc| or just type it in the 2092 items as well you can add the following to your |vimrc| or just type it in the
2093 command line before loading a file with the readline syntax: > 2093 command line before loading a file with the readline syntax: >
2094 let readline_has_bash = 1 2094 let readline_has_bash = 1
2095 2095
2096 This will add highlighting for the commands that BASH (version 2.05a and 2096 This will add highlighting for the commands that BASH (version 2.05a and
2111 RUBY *ruby.vim* *ruby-syntax* 2111 RUBY *ruby.vim* *ruby-syntax*
2112 2112
2113 There are a few options to the Ruby syntax highlighting. 2113 There are a few options to the Ruby syntax highlighting.
2114 2114
2115 By default, the "end" keyword is colorized according to the opening statement 2115 By default, the "end" keyword is colorized according to the opening statement
2116 of the block it closes. While useful, this feature can be expensive: if you 2116 of the block it closes. While useful, this feature can be expensive: if you
2117 experience slow redrawing (or you are on a terminal with poor color support) 2117 experience slow redrawing (or you are on a terminal with poor color support)
2118 you may want to turn it off by defining the "ruby_no_expensive" variable: > 2118 you may want to turn it off by defining the "ruby_no_expensive" variable: >
2119 :let ruby_no_expensive = 1 2119 :let ruby_no_expensive = 1
2120 In this case the same color will be used for all control keywords. 2120 In this case the same color will be used for all control keywords.
2121 2121
2149 The SDL highlighting probably misses a few keywords, but SDL has so many 2149 The SDL highlighting probably misses a few keywords, but SDL has so many
2150 of them it's almost impossibly to cope. 2150 of them it's almost impossibly to cope.
2151 2151
2152 The new standard, SDL-2000, specifies that all identifiers are 2152 The new standard, SDL-2000, specifies that all identifiers are
2153 case-sensitive (which was not so before), and that all keywords can be 2153 case-sensitive (which was not so before), and that all keywords can be
2154 used either completely lowercase or completely uppercase. To have the 2154 used either completely lowercase or completely uppercase. To have the
2155 highlighting reflect this, you can set the following variable: > 2155 highlighting reflect this, you can set the following variable: >
2156 :let sdl_2000=1 2156 :let sdl_2000=1
2157 2157
2158 This also sets many new keywords. If you want to disable the old 2158 This also sets many new keywords. If you want to disable the old
2159 keywords, which is probably a good idea, use: > 2159 keywords, which is probably a good idea, use: >
2160 :let SDL_no_96=1 2160 :let SDL_no_96=1
2161 2161
2162 2162
2163 The indentation is probably also incomplete, but right now I am very 2163 The indentation is probably also incomplete, but right now I am very
2197 defined for you) 2197 defined for you)
2198 2198
2199 Known tag names are colored the same way as statements in C. Unknown tag 2199 Known tag names are colored the same way as statements in C. Unknown tag
2200 names are not colored which makes it easy to spot errors. 2200 names are not colored which makes it easy to spot errors.
2201 2201
2202 Note that the same is true for argument (or attribute) names. Known attribute 2202 Note that the same is true for argument (or attribute) names. Known attribute
2203 names are colored differently than unknown ones. 2203 names are colored differently than unknown ones.
2204 2204
2205 Some SGML tags are used to change the rendering of text. The following tags 2205 Some SGML tags are used to change the rendering of text. The following tags
2206 are recognized by the sgml.vim syntax coloring file and change the way normal 2206 are recognized by the sgml.vim syntax coloring file and change the way normal
2207 text is shown: <varname> <emphasis> <command> <function> <literal> 2207 text is shown: <varname> <emphasis> <command> <function> <literal>
2208 <replaceable> <ulink> and <link>. 2208 <replaceable> <ulink> and <link>.
2209 2209
2210 If you want to change how such text is rendered, you must redefine the 2210 If you want to change how such text is rendered, you must redefine the
2287 sections and subsections will be highlighted as statements but not 2287 sections and subsections will be highlighted as statements but not
2288 other keywords (like WITHIN in the OPERATION section). 2288 other keywords (like WITHIN in the OPERATION section).
2289 2289
2290 - highlight_types : Definition of this variable causes stream types 2290 - highlight_types : Definition of this variable causes stream types
2291 like temperature or pressure to be highlighted as Type, not as a 2291 like temperature or pressure to be highlighted as Type, not as a
2292 plain Identifier. Included are the types that are usually found in 2292 plain Identifier. Included are the types that are usually found in
2293 the DECLARE section; if you defined own types, you have to include 2293 the DECLARE section; if you defined own types, you have to include
2294 them in the syntax file. 2294 them in the syntax file.
2295 2295
2296 - oneline_comments : this value ranges from 1 to 3 and determines the 2296 - oneline_comments : this value ranges from 1 to 3 and determines the
2297 highlighting of # style comments. 2297 highlighting of # style comments.
2298 2298
2299 oneline_comments = 1 : allow normal Speedup code after an even 2299 oneline_comments = 1 : allow normal Speedup code after an even
2300 number of #s. 2300 number of #s.
2301 2301
2302 oneline_comments = 2 : show code starting with the second # as 2302 oneline_comments = 2 : show code starting with the second # as
2303 error. This is the default setting. 2303 error. This is the default setting.
2304 2304
2305 oneline_comments = 3 : show the whole line as error if it contains 2305 oneline_comments = 3 : show the whole line as error if it contains
2306 more than one #. 2306 more than one #.
2307 2307
2308 Since especially OPERATION sections tend to become very large due to 2308 Since especially OPERATION sections tend to become very large due to
2309 PRESETting variables, syncing may be critical. If your computer is 2309 PRESETting variables, syncing may be critical. If your computer is
2310 fast enough, you can increase minlines and/or maxlines near the end of 2310 fast enough, you can increase minlines and/or maxlines near the end of
2311 the syntax file. 2311 the syntax file.
2312 2312
2313 2313
2314 SQL *sql.vim* *sql-syntax* 2314 SQL *sql.vim* *sql-syntax*
2326 2326
2327 This covers the shell named "tcsh". It is a superset of csh. See |csh.vim| 2327 This covers the shell named "tcsh". It is a superset of csh. See |csh.vim|
2328 for how the filetype is detected. 2328 for how the filetype is detected.
2329 2329
2330 Tcsh does not allow \" in strings unless the "backslash_quote" shell variable 2330 Tcsh does not allow \" in strings unless the "backslash_quote" shell variable
2331 is set. If you want VIM to assume that no backslash quote constructs exist add 2331 is set. If you want VIM to assume that no backslash quote constructs exist add
2332 this line to your .vimrc: > 2332 this line to your .vimrc: >
2333 2333
2334 :let tcsh_backslash_quote = 0 2334 :let tcsh_backslash_quote = 0
2335 2335
2336 If you notice highlighting errors while scrolling backwards, which are fixed 2336 If you notice highlighting errors while scrolling backwards, which are fixed
2338 to a larger number: > 2338 to a larger number: >
2339 2339
2340 :let tcsh_minlines = 100 2340 :let tcsh_minlines = 100
2341 2341
2342 This will make the syntax synchronization start 100 lines before the first 2342 This will make the syntax synchronization start 100 lines before the first
2343 displayed line. The default value is 15. The disadvantage of using a larger 2343 displayed line. The default value is 15. The disadvantage of using a larger
2344 number is that redrawing can become slow. 2344 number is that redrawing can become slow.
2345 2345
2346 2346
2347 TEX *tex.vim* *tex-syntax* 2347 TEX *tex.vim* *tex-syntax*
2348 2348
2362 2362
2363 If you have a slow computer, you may wish to reduce the values for > 2363 If you have a slow computer, you may wish to reduce the values for >
2364 :syn sync maxlines=200 2364 :syn sync maxlines=200
2365 :syn sync minlines=50 2365 :syn sync minlines=50
2366 (especially the latter). If your computer is fast, you may wish to 2366 (especially the latter). If your computer is fast, you may wish to
2367 increase them. This primarily affects synchronizing (ie. just what group, 2367 increase them. This primarily affects synchronizing (i.e. just what group,
2368 if any, is the text at the top of the screen supposed to be in?). 2368 if any, is the text at the top of the screen supposed to be in?).
2369 2369
2370 Excessive Error Highlighting? ~ 2370 Excessive Error Highlighting? ~
2371 2371
2372 The <tex.vim> supports lexical error checking of various sorts. Thus, 2372 The <tex.vim> supports lexical error checking of various sorts. Thus,
2459 highlighted. 2459 highlighted.
2460 2460
2461 2461
2462 XML *xml.vim* *xml-syntax* 2462 XML *xml.vim* *xml-syntax*
2463 2463
2464 Xml namespaces are highlighted by default. This can be inhibited by 2464 Xml namespaces are highlighted by default. This can be inhibited by
2465 setting a global variable: > 2465 setting a global variable: >
2466 2466
2467 :let g:xml_namespace_transparent=1 2467 :let g:xml_namespace_transparent=1
2468 < 2468 <
2469 *xml-folding* 2469 *xml-folding*
2470 The xml syntax file provides syntax |folding| (see |:syn-fold|) between 2470 The xml syntax file provides syntax |folding| (see |:syn-fold|) between
2471 start and end tags. This can be turned on by > 2471 start and end tags. This can be turned on by >
2472 2472
2473 :let g:xml_syntax_folding = 1 2473 :let g:xml_syntax_folding = 1
2474 :set foldmethod=syntax 2474 :set foldmethod=syntax
2475 2475
2476 Note: syntax folding might slow down syntax highlighting significantly, 2476 Note: syntax folding might slow down syntax highlighting significantly,
2605 The maximum length of a keyword is 80 characters. 2605 The maximum length of a keyword is 80 characters.
2606 2606
2607 The same keyword can be defined multiple times, when its containment 2607 The same keyword can be defined multiple times, when its containment
2608 differs. For example, you can define the keyword once not contained 2608 differs. For example, you can define the keyword once not contained
2609 and use one highlight group, and once contained, and use a different 2609 and use one highlight group, and once contained, and use a different
2610 highlight group. Example: > 2610 highlight group. Example: >
2611 :syn keyword vimCommand tag 2611 :syn keyword vimCommand tag
2612 :syn keyword vimSetting contained tag 2612 :syn keyword vimSetting contained tag
2613 < When finding "tag" outside of any syntax item, the "vimCommand" 2613 < When finding "tag" outside of any syntax item, the "vimCommand"
2614 highlight group is used. When finding "tag" in a syntax item that 2614 highlight group is used. When finding "tag" in a syntax item that
2615 contains "vimSetting", the "vimSetting" group is used. 2615 contains "vimSetting", the "vimSetting" group is used.
2661 See |:syn-matchgroup|. 2661 See |:syn-matchgroup|.
2662 keepend Don't allow contained matches to go past a 2662 keepend Don't allow contained matches to go past a
2663 match with the end pattern. See 2663 match with the end pattern. See
2664 |:syn-keepend|. 2664 |:syn-keepend|.
2665 extend Override a "keepend" for an item this region 2665 extend Override a "keepend" for an item this region
2666 is contained in. See |:syn-extend|. 2666 is contained in. See |:syn-extend|.
2667 excludenl Don't make a pattern with the end-of-line "$" 2667 excludenl Don't make a pattern with the end-of-line "$"
2668 extend a containing match or item. Only 2668 extend a containing match or item. Only
2669 useful for end patterns. Must be given before 2669 useful for end patterns. Must be given before
2670 the patterns it applies to. |:syn-excludenl| 2670 the patterns it applies to. |:syn-excludenl|
2671 start={start_pattern} The search pattern that defines the start of 2671 start={start_pattern} The search pattern that defines the start of
3734 "cterm=" argument AFTER the "ctermfg=" or "ctermbg=" argument. Or use 3734 "cterm=" argument AFTER the "ctermfg=" or "ctermbg=" argument. Or use
3735 a number instead of a color name. 3735 a number instead of a color name.
3736 3736
3737 The case of the color names is ignored. 3737 The case of the color names is ignored.
3738 Note that for 16 color ansi style terminals (including xterms), the 3738 Note that for 16 color ansi style terminals (including xterms), the
3739 numbers in the NR-8 column is used. Here '*' means 'add 8' so that Blue 3739 numbers in the NR-8 column is used. Here '*' means 'add 8' so that Blue
3740 is 12, DarkGray is 8 etc. 3740 is 12, DarkGray is 8 etc.
3741 3741
3742 Note that for some color terminals these names may result in the wrong 3742 Note that for some color terminals these names may result in the wrong
3743 colors! 3743 colors!
3744 3744
3922 *hl-WildMenu* 3922 *hl-WildMenu*
3923 WildMenu current match in 'wildmenu' completion 3923 WildMenu current match in 'wildmenu' completion
3924 3924
3925 *hl-User1* *hl-User1..9* 3925 *hl-User1* *hl-User1..9*
3926 The 'statusline' syntax allows the use of 9 different highlights in the 3926 The 'statusline' syntax allows the use of 9 different highlights in the
3927 statusline and ruler (via 'rulerformat'). The names are User1 to User9. 3927 statusline and ruler (via 'rulerformat'). The names are User1 to User9.
3928 3928
3929 For the GUI you can use these groups to set the colors for the menu, 3929 For the GUI you can use these groups to set the colors for the menu,
3930 scrollbars and tooltips. They don't have defaults. This doesn't work for the 3930 scrollbars and tooltips. They don't have defaults. This doesn't work for the
3931 Win32 GUI. Only three highlight arguments have any effect here: font, guibg, 3931 Win32 GUI. Only three highlight arguments have any effect here: font, guibg,
3932 and guifg. 3932 and guifg.
4149 To test your color setup, a file has been included in the Vim distribution. 4149 To test your color setup, a file has been included in the Vim distribution.
4150 To use it, execute these commands: > 4150 To use it, execute these commands: >
4151 :e $VIMRUNTIME/syntax/colortest.vim 4151 :e $VIMRUNTIME/syntax/colortest.vim
4152 :so % 4152 :so %
4153 4153
4154 Some versions of xterm (and other terminals, like the linux console) can 4154 Some versions of xterm (and other terminals, like the Linux console) can
4155 output lighter foreground colors, even though the number of colors is defined 4155 output lighter foreground colors, even though the number of colors is defined
4156 at 8. Therefore Vim sets the "cterm=bold" attribute for light foreground 4156 at 8. Therefore Vim sets the "cterm=bold" attribute for light foreground
4157 colors, when 't_Co' is 8. 4157 colors, when 't_Co' is 8.
4158 4158
4159 *xfree-xterm* 4159 *xfree-xterm*
4160 To get 16 colors or more, get the newest xterm version (which should be 4160 To get 16 colors or more, get the newest xterm version (which should be
4161 included with Xfree86 3.3 and later). You can also find the latest version 4161 included with XFree86 3.3 and later). You can also find the latest version
4162 at: > 4162 at: >
4163 http://invisible-island.net/xterm/xterm.html 4163 http://invisible-island.net/xterm/xterm.html
4164 Here is a good way to configure it. This uses 88 colors and enables the 4164 Here is a good way to configure it. This uses 88 colors and enables the
4165 termcap-query feature, which allows Vim to ask the xterm how many colors it 4165 termcap-query feature, which allows Vim to ask the xterm how many colors it
4166 supports. > 4166 supports. >