1
- *syntax.txt* For Vim version 8.2. Last change: 2021 Aug 16
1
+ *syntax.txt* For Vim version 8.2. Last change: 2021 Nov 20
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1081,33 +1081,47 @@ This works immediately.
1081
1081
1082
1082
CLOJURE *ft-clojure-syntax*
1083
1083
1084
- The default syntax groups can be augmented through the
1085
- *g:clojure_syntax_keywords* and *b:clojure_syntax_keywords* variables. The
1086
- value should be a | Dictionary | of syntax group names to a | List | of custom
1087
- identifiers:
1084
+ *g:clojure_syntax_keywords*
1085
+
1086
+ Syntax highlighting of public vars in "clojure.core" is provided by default,
1087
+ but additional symbols can be highlighted by adding them to the
1088
+ | g:clojure_syntax_keywords | variable. The value should be a | Dictionary | of
1089
+ syntax group names, each containing a | List | of identifiers.
1088
1090
>
1089
1091
let g:clojure_syntax_keywords = {
1090
- \ 'clojureMacro': ["defproject", "defcustom"],
1091
- \ 'clojureFunc': ["string/join", "string/replace"]
1092
+ \ 'clojureMacro': ["defproject", "defcustom"],
1093
+ \ 'clojureFunc': ["string/join", "string/replace"]
1092
1094
\ }
1093
1095
<
1094
1096
Refer to the Clojure syntax script for valid syntax group names.
1095
1097
1096
- If the | buffer-variable | *b:clojure_syntax_without_core_keywords* is set, only
1097
- language constants and special forms are matched.
1098
+ There is also *b:clojure_syntax_keywords* which is a buffer-local variant of
1099
+ this variable intended for use by plugin authors to highlight symbols
1100
+ dynamically.
1101
+
1102
+ By setting the *b:clojure_syntax_without_core_keywords* variable, vars from
1103
+ "clojure.core" will not be highlighted by default. This is useful for
1104
+ namespaces that have set `(:refer-clojure :only [])`
1105
+
1098
1106
1099
- Setting *g:clojure_fold* enables folding Clojure code via the syntax engine.
1100
- Any list, vector, or map that extends over more than one line can be folded
1101
- using the standard Vim | fold-commands | .
1107
+ *g:clojure_fold*
1102
1108
1103
- Please note that this option does not work with scripts that redefine the
1104
- bracket syntax regions, such as rainbow-parentheses plugins.
1109
+ Setting | g:clojure_fold | to `1 ` will enable the folding of Clojure code. Any
1110
+ list, vector or map that extends over more than one line can be folded using
1111
+ the standard Vim | fold-commands | .
1105
1112
1106
- This option is off by default.
1113
+
1114
+ *g:clojure_discard_macro*
1115
+
1116
+ Set this variable to `1 ` to enable basic highlighting of Clojure's "discard
1117
+ reader macro".
1107
1118
>
1108
- " Default
1109
- let g:clojure_fold = 0
1119
+ #_(defn foo [x]
1120
+ (println x))
1110
1121
<
1122
+ Note that this option will not correctly highlight stacked discard macros
1123
+ (e.g. `#_#_` ).
1124
+
1111
1125
1112
1126
COBOL *cobol.vim* *ft-cobol-syntax*
1113
1127
@@ -1519,6 +1533,14 @@ gvim display. Here, statements are colored LightYellow instead of Yellow, and
1519
1533
conditionals are LightBlue for better distinction.
1520
1534
1521
1535
1536
+ FORTH *forth.vim* *ft-forth-syntax*
1537
+
1538
+ Files matching "*.fs" could be F# or Forth. If the automatic detection
1539
+ doesn't work for you, or you don't edit F# at all, use this in your
1540
+ startup vimrc: >
1541
+ :let filetype_fs = "forth"
1542
+
1543
+
1522
1544
FORTRAN *fortran.vim* *ft-fortran-syntax*
1523
1545
1524
1546
Default highlighting and dialect ~
@@ -1673,16 +1695,6 @@ as Fvwm2 configuration files, add the following: >
1673
1695
:au! BufNewFile,BufRead /etc/X11/fvwm2/* let b:fvwm_version = 2 |
1674
1696
\ set filetype=fvwm
1675
1697
1676
- If you'd like Vim to highlight all valid color names, tell it where to
1677
- find the color database (rgb.txt) on your system. Do this by setting
1678
- "rgb_file" to its location. Assuming your color database is located
1679
- in /usr/X11/lib/X11/, you should add the line >
1680
-
1681
- :let rgb_file = "/usr/X11/lib/X11/rgb.txt"
1682
-
1683
- to your .vimrc file.
1684
-
1685
-
1686
1698
GSP *gsp.vim* *ft-gsp-syntax*
1687
1699
1688
1700
The default coloring style for GSP pages is defined by | html.vim | , and
@@ -4830,16 +4842,28 @@ in their own color.
4830
4842
Doesn't work recursively, thus you can't use
4831
4843
":colorscheme" in a color scheme script.
4832
4844
4833
- To customize a color scheme use another name, e.g.
4845
+ You have two options for customizing a color scheme.
4846
+ For changing the appearance of specific colors, you
4847
+ can redefine a color name before loading the scheme.
4848
+ The desert scheme uses the khaki color for the cursor.
4849
+ To use a darker variation of the same color: >
4850
+
4851
+ let v:colornames['khaki'] = '#bdb76b'
4852
+ colorscheme desert
4853
+ <
4854
+ For further customization, such as changing
4855
+ | :highlight-link | associations, use another name, e.g.
4834
4856
"~/.vim/colors/mine.vim", and use `:runtime ` to load
4835
4857
the original color scheme: >
4836
4858
runtime colors/evening.vim
4837
4859
hi Statement ctermfg=Blue guifg=Blue
4838
4860
4839
- < Before the color scheme will be loaded the
4840
- | ColorSchemePre | autocommand event is triggered.
4841
- After the color scheme has been loaded the
4842
- | ColorScheme | autocommand event is triggered.
4861
+ < Before the color scheme will be loaded all default
4862
+ color list scripts (`colors/lists/ default.vim ` ) will
4863
+ be executed and then the | ColorSchemePre | autocommand
4864
+ event is triggered. After the color scheme has been
4865
+ loaded the | ColorScheme | autocommand event is
4866
+ triggered.
4843
4867
For info about writing a color scheme file: >
4844
4868
:edit $VIMRUNTIME/colors/README.txt
4845
4869
@@ -4849,6 +4873,7 @@ in their own color.
4849
4873
:hi[ghlight] {group-name}
4850
4874
List one highlight group.
4851
4875
4876
+ *highlight-clear*
4852
4877
:hi[ghlight] clear Reset all highlighting to the defaults. Removes all
4853
4878
highlighting for groups added by the user!
4854
4879
Uses the current value of 'background' to decide which
@@ -4862,7 +4887,9 @@ in their own color.
4862
4887
4863
4888
:hi[ghlight] [default] {group-name} {key} ={arg} ..
4864
4889
Add a highlight group, or change the highlighting for
4865
- an existing group.
4890
+ an existing group. If a given color name is not
4891
+ recognized, each `colors/lists/ default.vim ` found on
4892
+ | 'runtimepath' | will be loaded.
4866
4893
See | highlight-args | for the {key} ={arg} arguments.
4867
4894
See | :highlight-default | for the optional [default]
4868
4895
argument.
@@ -5143,8 +5170,35 @@ guisp={color-name} *highlight-guisp*
5143
5170
"gg" is the Green value
5144
5171
"bb" is the Blue value
5145
5172
All values are hexadecimal, range from "00" to "ff". Examples: >
5146
- :highlight Comment guifg=#11f0c3 guibg=#ff00ff
5173
+ :highlight Comment guifg=#11f0c3 guibg=#ff00ff
5174
+ <
5175
+ If you are authoring a color scheme and use the same hexademical value
5176
+ repeatedly, you can define a name for it in | v:colornames | . For
5177
+ example: >
5178
+
5179
+ # provide a default value for this color but allow the user to
5180
+ # override it.
5181
+ :call extend(v:colornames, {'alt_turquoise': '#11f0c3'}, 'keep')
5182
+ :highlight Comment guifg=alt_turquoise guibg=magenta
5147
5183
<
5184
+ If you are using a color scheme that relies on named colors and you
5185
+ would like to adjust the precise appearance of those colors, you can
5186
+ do so by overriding the values in | v:colornames | prior to loading the
5187
+ scheme: >
5188
+
5189
+ let v:colornames['alt_turquoise'] = '#22f0d3'
5190
+ colorscheme alt
5191
+ <
5192
+ If you want to develop a color list that can be relied on by others,
5193
+ it is best to prefix your color names. By convention these color lists
5194
+ are placed in the colors/lists directory. You can see an example in
5195
+ '$VIMRUNTIME/colors/lists/csscolors.vim'. This list would be sourced
5196
+ by a color scheme using: >
5197
+
5198
+ :runtime colors/lists/csscolors.vim
5199
+ :highlight Comment guifg=css_turquoise
5200
+ <
5201
+
5148
5202
*highlight-groups* *highlight-default*
5149
5203
These are the default highlighting groups. These groups are used by the
5150
5204
'highlight' option default. Note that the highlighting depends on the value
@@ -5205,6 +5259,10 @@ LineNrBelow Line number for when the 'relativenumber'
5205
5259
*hl-CursorLineNr*
5206
5260
CursorLineNr Like LineNr when 'cursorline' is set and 'cursorlineopt'
5207
5261
contains "number" or is "both", for the cursor line.
5262
+ *hl-CursorLineSign*
5263
+ CursorLineSign Like SignColumn when 'cursorline' is set for the cursor line.
5264
+ *hl-CursorLineFold*
5265
+ CursorLineFold Like FoldColumn when 'cursorline' is set for the cursor line.
5208
5266
*hl-MatchParen*
5209
5267
MatchParen The character under the cursor or just before it, if it
5210
5268
is a paired bracket, and its match. | pi_paren.txt |
@@ -5431,7 +5489,7 @@ For Unix you can use the file ~/.vim/after/syntax/syncolor.vim. Example: >
5431
5489
else
5432
5490
highlight comment ctermfg=green guifg=green
5433
5491
endif
5434
-
5492
+ <
5435
5493
*E679*
5436
5494
Do make sure this syncolor.vim script does not use a "syntax on", set the
5437
5495
'background' option or uses a "colorscheme" command, because it results in an
@@ -5444,11 +5502,11 @@ depends on the color scheme file. See |:colorscheme|.
5444
5502
*syntax_cmd*
5445
5503
The "syntax_cmd" variable is set to one of these values when the
5446
5504
syntax/syncolor.vim files are loaded:
5447
- "on" " :syntax on" command. Highlight colors are overruled but
5505
+ "on" ` :syntax on` command. Highlight colors are overruled but
5448
5506
links are kept
5449
- "enable" " :syntax enable" command. Only define colors for groups that
5450
- don't have highlighting yet. Use ":syntax default" .
5451
- "reset" " :syntax reset" command or loading a color scheme. Define all
5507
+ "enable" ` :syntax enable` command. Only define colors for groups that
5508
+ don't have highlighting yet. Use `:highlight default` .
5509
+ "reset" ` :syntax reset` command or loading a color scheme. Define all
5452
5510
the colors.
5453
5511
"skip" Don't define colors. Used to skip the default settings when a
5454
5512
syncolor.vim file earlier in 'runtimepath' has already set
0 commit comments