xref: /vim-8.2.3635/runtime/syntax/syncolor.vim (revision ebdf3c96)
1" Vim syntax support file
2" Maintainer:	Bram Moolenaar <[email protected]>
3" Last Change:	2020 Feb 13
4
5" This file sets up the default methods for highlighting.
6" It is loaded from "synload.vim" and from Vim for ":syntax reset".
7" Also used from init_highlight().
8
9if !exists("syntax_cmd") || syntax_cmd == "on"
10  " ":syntax on" works like in Vim 5.7: set colors but keep links
11  command -nargs=* SynColor hi <args>
12  command -nargs=* SynLink hi link <args>
13else
14  if syntax_cmd == "enable"
15    " ":syntax enable" keeps any existing colors
16    command -nargs=* SynColor hi def <args>
17    command -nargs=* SynLink hi def link <args>
18  elseif syntax_cmd == "reset"
19    " ":syntax reset" resets all colors to the default
20    command -nargs=* SynColor hi <args>
21    command -nargs=* SynLink hi! link <args>
22  else
23    " User defined syncolor file has already set the colors.
24    finish
25  endif
26endif
27
28" Many terminals can only use six different colors (plus black and white).
29" Therefore the number of colors used is kept low. It doesn't look nice with
30" too many colors anyway.
31" Careful with "cterm=bold", it changes the color to bright for some terminals.
32" There are two sets of defaults: for a dark and a light background.
33if &background == "dark"
34  SynColor Comment	term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE
35  SynColor Constant	term=underline cterm=NONE ctermfg=Magenta ctermbg=NONE gui=NONE guifg=#ffa0a0 guibg=NONE
36  SynColor Special	term=bold cterm=NONE ctermfg=LightRed ctermbg=NONE gui=NONE guifg=Orange guibg=NONE
37  SynColor Identifier	term=underline cterm=bold ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#40ffff guibg=NONE
38  SynColor Statement	term=bold cterm=NONE ctermfg=Yellow ctermbg=NONE gui=bold guifg=#ffff60 guibg=NONE
39  SynColor PreProc	term=underline cterm=NONE ctermfg=LightBlue ctermbg=NONE gui=NONE guifg=#ff80ff guibg=NONE
40  SynColor Type		term=underline cterm=NONE ctermfg=LightGreen ctermbg=NONE gui=bold guifg=#60ff60 guibg=NONE
41  SynColor Underlined	term=underline cterm=underline ctermfg=LightBlue gui=underline guifg=#80a0ff
42  SynColor Ignore	term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=bg guibg=NONE
43else
44  SynColor Comment	term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
45  SynColor Constant	term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
46  " #6a5acd is SlateBlue
47  SynColor Special	term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=#6a5acd guibg=NONE
48  SynColor Identifier	term=underline cterm=NONE ctermfg=DarkCyan ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
49  SynColor Statement	term=bold cterm=NONE ctermfg=Brown ctermbg=NONE gui=bold guifg=Brown guibg=NONE
50  " #6a0dad is Purple
51  SynColor PreProc	term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=#6a0dad guibg=NONE
52  SynColor Type		term=underline cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
53  SynColor Underlined	term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
54  SynColor Ignore	term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
55endif
56SynColor Error		term=reverse cterm=NONE ctermfg=White ctermbg=Red gui=NONE guifg=White guibg=Red
57SynColor Todo		term=standout cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Blue guibg=Yellow
58
59" Common groups that link to default highlighting.
60" You can specify other highlighting easily.
61SynLink String		Constant
62SynLink Character	Constant
63SynLink Number		Constant
64SynLink Boolean		Constant
65SynLink Float		Number
66SynLink Function	Identifier
67SynLink Conditional	Statement
68SynLink Repeat		Statement
69SynLink Label		Statement
70SynLink Operator	Statement
71SynLink Keyword		Statement
72SynLink Exception	Statement
73SynLink Include		PreProc
74SynLink Define		PreProc
75SynLink Macro		PreProc
76SynLink PreCondit	PreProc
77SynLink StorageClass	Type
78SynLink Structure	Type
79SynLink Typedef		Type
80SynLink Tag		Special
81SynLink SpecialChar	Special
82SynLink Delimiter	Special
83SynLink SpecialComment	Special
84SynLink Debug		Special
85
86delcommand SynColor
87delcommand SynLink
88