onedark.vim (30932B) - raw


      1 " vim:fdm=marker
      2 " Vim Color File
      3 " Name:       onedark.vim
      4 " Maintainer: https://github.com/joshdick/onedark.vim/
      5 " License:    The MIT License (MIT)
      6 " Based On:   https://github.com/MaxSt/FlatColor/
      7 
      8 " Companion statusline plugin and terminal themes are included with onedark.vim:
      9 "  * https://github.com/joshdick/onedark.vim#lightlinevim-colorscheme
     10 "  * https://github.com/joshdick/onedark.vim#vim-airline-theme
     11 "  * https://github.com/joshdick/onedark.vim/tree/main/term
     12 
     13 " Color Reference {{{
     14 
     15 " The following colors were measured inside Atom using its built-in inspector.
     16 
     17 " +---------------------------------------------+
     18 " |  Color Name  |         RGB        |   Hex   |
     19 " |--------------+--------------------+---------|
     20 " | Black        | rgb(40, 44, 52)    | #282c34 |
     21 " |--------------+--------------------+---------|
     22 " | White        | rgb(171, 178, 191) | #abb2bf |
     23 " |--------------+--------------------+---------|
     24 " | Light Red    | rgb(224, 108, 117) | #e06c75 |
     25 " |--------------+--------------------+---------|
     26 " | Dark Red     | rgb(190, 80, 70)   | #be5046 |
     27 " |--------------+--------------------+---------|
     28 " | Green        | rgb(152, 195, 121) | #98c379 |
     29 " |--------------+--------------------+---------|
     30 " | Light Yellow | rgb(229, 192, 123) | #e5c07b |
     31 " |--------------+--------------------+---------|
     32 " | Dark Yellow  | rgb(209, 154, 102) | #d19a66 |
     33 " |--------------+--------------------+---------|
     34 " | Blue         | rgb(97, 175, 239)  | #61afef |
     35 " |--------------+--------------------+---------|
     36 " | Magenta      | rgb(198, 120, 221) | #c678dd |
     37 " |--------------+--------------------+---------|
     38 " | Cyan         | rgb(86, 182, 194)  | #56b6c2 |
     39 " |--------------+--------------------+---------|
     40 " | Gutter Grey  | rgb(76, 82, 99)    | #4b5263 |
     41 " |--------------+--------------------+---------|
     42 " | Comment Grey | rgb(92, 99, 112)   | #5c6370 |
     43 " +---------------------------------------------+
     44 
     45 " }}}
     46 
     47 " Initialization {{{
     48 
     49 highlight clear
     50 
     51 if exists("syntax_on")
     52   syntax reset
     53 endif
     54 
     55 set t_Co=256
     56 
     57 let g:colors_name="onedark"
     58 
     59 " Set to "256" for 256-color terminals, or
     60 " set to "16" to use your terminal emulator's native colors
     61 " (a 16-color palette for this color scheme is available; see
     62 " < https://github.com/joshdick/onedark.vim/blob/main/README.md >
     63 " for more information.)
     64 if !exists("g:onedark_termcolors")
     65   let g:onedark_termcolors = 256
     66 endif
     67 
     68 " Not all terminals support italics properly. If yours does, opt-in.
     69 if !exists("g:onedark_terminal_italics")
     70   let g:onedark_terminal_italics = 0
     71 endif
     72 
     73 " This function is based on one from FlatColor: https://github.com/MaxSt/FlatColor/
     74 " Which in turn was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/
     75 let s:group_colors = {} " Cache of default highlight group settings, for later reference via `onedark#extend_highlight`
     76 function! s:h(group, style, ...)
     77   if (a:0 > 0) " Will be true if we got here from onedark#extend_highlight
     78     let s:highlight = s:group_colors[a:group]
     79     for style_type in ["fg", "bg", "sp"]
     80       if (has_key(a:style, style_type))
     81         let l:default_style = (has_key(s:highlight, style_type) ? copy(s:highlight[style_type]) : { "cterm16": "NONE", "cterm": "NONE", "gui": "NONE" })
     82         let s:highlight[style_type] = extend(l:default_style, a:style[style_type])
     83       endif
     84     endfor
     85     if (has_key(a:style, "gui"))
     86       let s:highlight.gui = a:style.gui
     87     endif
     88   else
     89     let s:highlight = a:style
     90     let s:group_colors[a:group] = s:highlight " Cache default highlight group settings
     91   endif
     92 
     93   if g:onedark_terminal_italics == 0
     94     if has_key(s:highlight, "cterm") && s:highlight["cterm"] == "italic"
     95       unlet s:highlight.cterm
     96     endif
     97     if has_key(s:highlight, "gui") && s:highlight["gui"] == "italic"
     98       unlet s:highlight.gui
     99     endif
    100   endif
    101 
    102   if g:onedark_termcolors == 16
    103     let l:ctermfg = (has_key(s:highlight, "fg") ? s:highlight.fg.cterm16 : "NONE")
    104     let l:ctermbg = (has_key(s:highlight, "bg") ? s:highlight.bg.cterm16 : "NONE")
    105   else
    106     let l:ctermfg = (has_key(s:highlight, "fg") ? s:highlight.fg.cterm : "NONE")
    107     let l:ctermbg = (has_key(s:highlight, "bg") ? s:highlight.bg.cterm : "NONE")
    108   endif
    109 
    110   execute "highlight" a:group
    111     \ "guifg="   (has_key(s:highlight, "fg")    ? s:highlight.fg.gui   : "NONE")
    112     \ "guibg="   (has_key(s:highlight, "bg")    ? s:highlight.bg.gui   : "NONE")
    113     \ "guisp="   (has_key(s:highlight, "sp")    ? s:highlight.sp.gui   : "NONE")
    114     \ "gui="     (has_key(s:highlight, "gui")   ? s:highlight.gui      : "NONE")
    115     \ "ctermfg=" . l:ctermfg
    116     \ "ctermbg=" . l:ctermbg
    117     \ "cterm="   (has_key(s:highlight, "cterm") ? s:highlight.cterm    : "NONE")
    118 endfunction
    119 
    120 " public {{{
    121 
    122 function! onedark#set_highlight(group, style)
    123   call s:h(a:group, a:style)
    124 endfunction
    125 
    126 function! onedark#extend_highlight(group, style)
    127   call s:h(a:group, a:style, 1)
    128 endfunction
    129 
    130 " }}}
    131 
    132 " }}}
    133 
    134 " Color Variables {{{
    135 
    136 let s:colors = onedark#GetColors()
    137 
    138 let s:red = s:colors.red
    139 let s:dark_red = s:colors.dark_red
    140 let s:green = s:colors.green
    141 let s:yellow = s:colors.yellow
    142 let s:dark_yellow = s:colors.dark_yellow
    143 let s:blue = s:colors.blue
    144 let s:purple = s:colors.purple
    145 let s:cyan = s:colors.cyan
    146 let s:white = s:colors.white
    147 let s:black = s:colors.black
    148 let s:foreground = s:colors.foreground
    149 let s:background = s:colors.background
    150 let s:comment_grey = s:colors.comment_grey
    151 let s:gutter_fg_grey = s:colors.gutter_fg_grey
    152 let s:cursor_grey = s:colors.cursor_grey
    153 let s:visual_grey = s:colors.visual_grey
    154 let s:menu_grey = s:colors.menu_grey
    155 let s:special_grey = s:colors.special_grey
    156 let s:vertsplit = s:colors.vertsplit
    157 
    158 " }}}
    159 
    160 " Terminal Colors {{{
    161 
    162 let g:terminal_ansi_colors = [
    163   \ s:black.gui, s:red.gui, s:green.gui, s:yellow.gui,
    164   \ s:blue.gui, s:purple.gui, s:cyan.gui, s:comment_grey.gui,
    165   \ s:visual_grey.gui, s:red.gui, s:green.gui, s:yellow.gui,
    166   \ s:blue.gui, s:purple.gui, s:cyan.gui, s:white.gui
    167 \]
    168 
    169 " }}}
    170 
    171 " Syntax Groups (descriptions and ordering from `:h w18`) {{{
    172 
    173 call s:h("Comment", { "fg": s:comment_grey, "gui": "italic", "cterm": "italic" }) " any comment
    174 call s:h("Constant", { "fg": s:cyan }) " any constant
    175 call s:h("String", { "fg": s:green }) " a string constant: "this is a string"
    176 call s:h("Character", { "fg": s:green }) " a character constant: 'c', '\n'
    177 call s:h("Number", { "fg": s:dark_yellow }) " a number constant: 234, 0xff
    178 call s:h("Boolean", { "fg": s:dark_yellow }) " a boolean constant: TRUE, false
    179 call s:h("Float", { "fg": s:dark_yellow }) " a floating point constant: 2.3e10
    180 call s:h("Identifier", { "fg": s:red }) " any variable name
    181 call s:h("Function", { "fg": s:blue }) " function name (also: methods for classes)
    182 call s:h("Statement", { "fg": s:purple }) " any statement
    183 call s:h("Conditional", { "fg": s:purple }) " if, then, else, endif, switch, etc.
    184 call s:h("Repeat", { "fg": s:purple }) " for, do, while, etc.
    185 call s:h("Label", { "fg": s:purple }) " case, default, etc.
    186 call s:h("Operator", { "fg": s:purple }) " sizeof", "+", "*", etc.
    187 call s:h("Keyword", { "fg": s:red }) " any other keyword
    188 call s:h("Exception", { "fg": s:purple }) " try, catch, throw
    189 call s:h("PreProc", { "fg": s:yellow }) " generic Preprocessor
    190 call s:h("Include", { "fg": s:blue }) " preprocessor #include
    191 call s:h("Define", { "fg": s:purple }) " preprocessor #define
    192 call s:h("Macro", { "fg": s:purple }) " same as Define
    193 call s:h("PreCondit", { "fg": s:yellow }) " preprocessor #if, #else, #endif, etc.
    194 call s:h("Type", { "fg": s:yellow }) " int, long, char, etc.
    195 call s:h("StorageClass", { "fg": s:yellow }) " static, register, volatile, etc.
    196 call s:h("Structure", { "fg": s:yellow }) " struct, union, enum, etc.
    197 call s:h("Typedef", { "fg": s:yellow }) " A typedef
    198 call s:h("Special", { "fg": s:blue }) " any special symbol
    199 call s:h("SpecialChar", { "fg": s:dark_yellow }) " special character in a constant
    200 call s:h("Tag", {}) " you can use CTRL-] on this
    201 call s:h("Delimiter", {}) " character that needs attention
    202 call s:h("SpecialComment", { "fg": s:comment_grey }) " special things inside a comment
    203 call s:h("Debug", {}) " debugging statements
    204 call s:h("Underlined", { "gui": "underline", "cterm": "underline" }) " text that stands out, HTML links
    205 call s:h("Ignore", {}) " left blank, hidden
    206 call s:h("Error", { "fg": s:red }) " any erroneous construct
    207 call s:h("Todo", { "fg": s:purple }) " anything that needs extra attention; mostly the keywords TODO FIXME and XXX
    208 
    209 " }}}
    210 
    211 " Highlighting Groups (descriptions and ordering from `:h highlight-groups`) {{{
    212 call s:h("ColorColumn", { "bg": s:cursor_grey }) " used for the columns set with 'colorcolumn'
    213 call s:h("Conceal", {}) " placeholder characters substituted for concealed text (see 'conceallevel')
    214 call s:h("Cursor", { "fg": s:black, "bg": s:blue }) " the character under the cursor
    215 call s:h("CursorIM", {}) " like Cursor, but used when in IME mode
    216 call s:h("CursorColumn", { "bg": s:cursor_grey }) " the screen column that the cursor is in when 'cursorcolumn' is set
    217 if &diff
    218   " Don't change the background color in diff mode
    219   call s:h("CursorLine", { "gui": "underline" }) " the screen line that the cursor is in when 'cursorline' is set
    220 else
    221   call s:h("CursorLine", { "bg": s:cursor_grey }) " the screen line that the cursor is in when 'cursorline' is set
    222 endif
    223 call s:h("Directory", { "fg": s:blue }) " directory names (and other special names in listings)
    224 call s:h("DiffAdd", { "bg": s:green, "fg": s:black }) " diff mode: Added line
    225 call s:h("DiffChange", { "fg": s:yellow, "gui": "underline", "cterm": "underline" }) " diff mode: Changed line
    226 call s:h("DiffDelete", { "bg": s:red, "fg": s:black }) " diff mode: Deleted line
    227 call s:h("DiffText", { "bg": s:yellow, "fg": s:black }) " diff mode: Changed text within a changed line
    228 if get(g:, 'onedark_hide_endofbuffer', 0)
    229     " If enabled, will style end-of-buffer filler lines (~) to appear to be hidden.
    230     call s:h("EndOfBuffer", { "fg": s:black }) " filler lines (~) after the last line in the buffer
    231 endif
    232 call s:h("ErrorMsg", { "fg": s:red }) " error messages on the command line
    233 call s:h("VertSplit", { "fg": s:vertsplit }) " the column separating vertically split windows
    234 call s:h("Folded", { "fg": s:comment_grey }) " line used for closed folds
    235 call s:h("FoldColumn", {}) " 'foldcolumn'
    236 call s:h("SignColumn", {}) " column where signs are displayed
    237 call s:h("IncSearch", { "fg": s:yellow, "bg": s:comment_grey }) " 'incsearch' highlighting; also used for the text replaced with ":s///c"
    238 call s:h("LineNr", { "fg": s:gutter_fg_grey }) " Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
    239 call s:h("CursorLineNr", {}) " Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
    240 call s:h("MatchParen", { "fg": s:blue, "gui": "underline", "cterm": "underline" }) " The character under the cursor or just before it, if it is a paired bracket, and its match.
    241 call s:h("ModeMsg", {}) " 'showmode' message (e.g., "-- INSERT --")
    242 call s:h("MoreMsg", {}) " more-prompt
    243 call s:h("NonText", { "fg": s:special_grey }) " '~' and '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line).
    244 call s:h("Normal", { "fg": s:foreground, "bg": s:background }) " normal text
    245 call s:h("Pmenu", { "fg": s:white, "bg": s:menu_grey }) " Popup menu: normal item.
    246 call s:h("PmenuSel", { "fg": s:cursor_grey, "bg": s:blue }) " Popup menu: selected item.
    247 call s:h("PmenuSbar", { "bg": s:cursor_grey }) " Popup menu: scrollbar.
    248 call s:h("PmenuThumb", { "bg": s:white }) " Popup menu: Thumb of the scrollbar.
    249 call s:h("Question", { "fg": s:purple }) " hit-enter prompt and yes/no questions
    250 call s:h("QuickFixLine", { "fg": s:black, "bg": s:yellow }) " Current quickfix item in the quickfix window.
    251 call s:h("Search", { "fg": s:black, "bg": s:yellow }) " Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
    252 call s:h("SpecialKey", { "fg": s:special_grey }) " Meta and special keys listed with ":map", also for text used to show unprintable characters in the text, 'listchars'. Generally: text that is displayed differently from what it really is.
    253 call s:h("SpellBad", { "fg": s:red, "gui": "underline", "cterm": "underline" }) " Word that is not recognized by the spellchecker. This will be combined with the highlighting used otherwise.
    254 call s:h("SpellCap", { "fg": s:dark_yellow }) " Word that should start with a capital. This will be combined with the highlighting used otherwise.
    255 call s:h("SpellLocal", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is used in another region. This will be combined with the highlighting used otherwise.
    256 call s:h("SpellRare", { "fg": s:dark_yellow }) " Word that is recognized by the spellchecker as one that is hardly ever used. spell This will be combined with the highlighting used otherwise.
    257 call s:h("StatusLine", { "fg": s:white, "bg": s:cursor_grey }) " status line of current window
    258 call s:h("StatusLineNC", { "fg": s:comment_grey }) " status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
    259 call s:h("StatusLineTerm", { "fg": s:white, "bg": s:cursor_grey }) " status line of current :terminal window
    260 call s:h("StatusLineTermNC", { "fg": s:comment_grey }) " status line of non-current :terminal window
    261 call s:h("TabLine", { "fg": s:comment_grey }) " tab pages line, not active tab page label
    262 call s:h("TabLineFill", {}) " tab pages line, where there are no labels
    263 call s:h("TabLineSel", { "fg": s:white }) " tab pages line, active tab page label
    264 call s:h("Terminal", { "fg": s:white, "bg": s:black }) " terminal window (see terminal-size-color)
    265 call s:h("Title", { "fg": s:green }) " titles for output from ":set all", ":autocmd" etc.
    266 call s:h("Visual", { "bg": s:visual_grey }) " Visual mode selection
    267 call s:h("VisualNOS", { "bg": s:visual_grey }) " Visual mode selection when vim is "Not Owning the Selection". Only X11 Gui's gui-x11 and xterm-clipboard supports this.
    268 call s:h("WarningMsg", { "fg": s:yellow }) " warning messages
    269 call s:h("WildMenu", { "fg": s:black, "bg": s:blue }) " current match in 'wildmenu' completion
    270 
    271 " }}}
    272 
    273 " Termdebug highlighting for Vim 8.1+ {{{
    274 
    275 " See `:h hl-debugPC` and `:h hl-debugBreakpoint`.
    276 call s:h("debugPC", { "bg": s:special_grey }) " the current position
    277 call s:h("debugBreakpoint", { "fg": s:black, "bg": s:red }) " a breakpoint
    278 
    279 " }}}
    280 
    281 " Language-Specific Highlighting {{{
    282 
    283 " CSS
    284 call s:h("cssAttrComma", { "fg": s:purple })
    285 call s:h("cssAttributeSelector", { "fg": s:green })
    286 call s:h("cssBraces", { "fg": s:white })
    287 call s:h("cssClassName", { "fg": s:dark_yellow })
    288 call s:h("cssClassNameDot", { "fg": s:dark_yellow })
    289 call s:h("cssDefinition", { "fg": s:purple })
    290 call s:h("cssFontAttr", { "fg": s:dark_yellow })
    291 call s:h("cssFontDescriptor", { "fg": s:purple })
    292 call s:h("cssFunctionName", { "fg": s:blue })
    293 call s:h("cssIdentifier", { "fg": s:blue })
    294 call s:h("cssImportant", { "fg": s:purple })
    295 call s:h("cssInclude", { "fg": s:white })
    296 call s:h("cssIncludeKeyword", { "fg": s:purple })
    297 call s:h("cssMediaType", { "fg": s:dark_yellow })
    298 call s:h("cssProp", { "fg": s:white })
    299 call s:h("cssPseudoClassId", { "fg": s:dark_yellow })
    300 call s:h("cssSelectorOp", { "fg": s:purple })
    301 call s:h("cssSelectorOp2", { "fg": s:purple })
    302 call s:h("cssTagName", { "fg": s:red })
    303 
    304 " Fish Shell
    305 call s:h("fishKeyword", { "fg": s:purple })
    306 call s:h("fishConditional", { "fg": s:purple })
    307 
    308 " Go
    309 call s:h("goDeclaration", { "fg": s:purple })
    310 call s:h("goBuiltins", { "fg": s:cyan })
    311 call s:h("goFunctionCall", { "fg": s:blue })
    312 call s:h("goVarDefs", { "fg": s:red })
    313 call s:h("goVarAssign", { "fg": s:red })
    314 call s:h("goVar", { "fg": s:purple })
    315 call s:h("goConst", { "fg": s:purple })
    316 call s:h("goType", { "fg": s:yellow })
    317 call s:h("goTypeName", { "fg": s:yellow })
    318 call s:h("goDeclType", { "fg": s:cyan })
    319 call s:h("goTypeDecl", { "fg": s:purple })
    320 
    321 " HTML (keep consistent with Markdown, below)
    322 call s:h("htmlArg", { "fg": s:dark_yellow })
    323 call s:h("htmlBold", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" })
    324 call s:h("htmlEndTag", { "fg": s:white })
    325 call s:h("htmlH1", { "fg": s:red })
    326 call s:h("htmlH2", { "fg": s:red })
    327 call s:h("htmlH3", { "fg": s:red })
    328 call s:h("htmlH4", { "fg": s:red })
    329 call s:h("htmlH5", { "fg": s:red })
    330 call s:h("htmlH6", { "fg": s:red })
    331 call s:h("htmlItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" })
    332 call s:h("htmlLink", { "fg": s:cyan, "gui": "underline", "cterm": "underline" })
    333 call s:h("htmlSpecialChar", { "fg": s:dark_yellow })
    334 call s:h("htmlSpecialTagName", { "fg": s:red })
    335 call s:h("htmlTag", { "fg": s:white })
    336 call s:h("htmlTagN", { "fg": s:red })
    337 call s:h("htmlTagName", { "fg": s:red })
    338 call s:h("htmlTitle", { "fg": s:white })
    339 
    340 " JavaScript
    341 call s:h("javaScriptBraces", { "fg": s:white })
    342 call s:h("javaScriptFunction", { "fg": s:purple })
    343 call s:h("javaScriptIdentifier", { "fg": s:purple })
    344 call s:h("javaScriptNull", { "fg": s:dark_yellow })
    345 call s:h("javaScriptNumber", { "fg": s:dark_yellow })
    346 call s:h("javaScriptRequire", { "fg": s:cyan })
    347 call s:h("javaScriptReserved", { "fg": s:purple })
    348 " https://github.com/pangloss/vim-javascript
    349 call s:h("jsArrowFunction", { "fg": s:purple })
    350 call s:h("jsClassKeyword", { "fg": s:purple })
    351 call s:h("jsClassMethodType", { "fg": s:purple })
    352 call s:h("jsDocParam", { "fg": s:blue })
    353 call s:h("jsDocTags", { "fg": s:purple })
    354 call s:h("jsExport", { "fg": s:purple })
    355 call s:h("jsExportDefault", { "fg": s:purple })
    356 call s:h("jsExtendsKeyword", { "fg": s:purple })
    357 call s:h("jsFrom", { "fg": s:purple })
    358 call s:h("jsFuncCall", { "fg": s:blue })
    359 call s:h("jsFunction", { "fg": s:purple })
    360 call s:h("jsGenerator", { "fg": s:yellow })
    361 call s:h("jsGlobalObjects", { "fg": s:yellow })
    362 call s:h("jsImport", { "fg": s:purple })
    363 call s:h("jsModuleAs", { "fg": s:purple })
    364 call s:h("jsModuleWords", { "fg": s:purple })
    365 call s:h("jsModules", { "fg": s:purple })
    366 call s:h("jsNull", { "fg": s:dark_yellow })
    367 call s:h("jsOperator", { "fg": s:purple })
    368 call s:h("jsStorageClass", { "fg": s:purple })
    369 call s:h("jsSuper", { "fg": s:red })
    370 call s:h("jsTemplateBraces", { "fg": s:dark_red })
    371 call s:h("jsTemplateVar", { "fg": s:green })
    372 call s:h("jsThis", { "fg": s:red })
    373 call s:h("jsUndefined", { "fg": s:dark_yellow })
    374 " https://github.com/othree/yajs.vim
    375 call s:h("javascriptArrowFunc", { "fg": s:purple })
    376 call s:h("javascriptClassExtends", { "fg": s:purple })
    377 call s:h("javascriptClassKeyword", { "fg": s:purple })
    378 call s:h("javascriptDocNotation", { "fg": s:purple })
    379 call s:h("javascriptDocParamName", { "fg": s:blue })
    380 call s:h("javascriptDocTags", { "fg": s:purple })
    381 call s:h("javascriptEndColons", { "fg": s:white })
    382 call s:h("javascriptExport", { "fg": s:purple })
    383 call s:h("javascriptFuncArg", { "fg": s:white })
    384 call s:h("javascriptFuncKeyword", { "fg": s:purple })
    385 call s:h("javascriptIdentifier", { "fg": s:red })
    386 call s:h("javascriptImport", { "fg": s:purple })
    387 call s:h("javascriptMethodName", { "fg": s:white })
    388 call s:h("javascriptObjectLabel", { "fg": s:white })
    389 call s:h("javascriptOpSymbol", { "fg": s:cyan })
    390 call s:h("javascriptOpSymbols", { "fg": s:cyan })
    391 call s:h("javascriptPropertyName", { "fg": s:green })
    392 call s:h("javascriptTemplateSB", { "fg": s:dark_red })
    393 call s:h("javascriptVariable", { "fg": s:purple })
    394 
    395 " JSON
    396 call s:h("jsonCommentError", { "fg": s:white })
    397 call s:h("jsonKeyword", { "fg": s:red })
    398 call s:h("jsonBoolean", { "fg": s:dark_yellow })
    399 call s:h("jsonNumber", { "fg": s:dark_yellow })
    400 call s:h("jsonQuote", { "fg": s:white })
    401 call s:h("jsonMissingCommaError", { "fg": s:red, "gui": "reverse" })
    402 call s:h("jsonNoQuotesError", { "fg": s:red, "gui": "reverse" })
    403 call s:h("jsonNumError", { "fg": s:red, "gui": "reverse" })
    404 call s:h("jsonString", { "fg": s:green })
    405 call s:h("jsonStringSQError", { "fg": s:red, "gui": "reverse" })
    406 call s:h("jsonSemicolonError", { "fg": s:red, "gui": "reverse" })
    407 
    408 " LESS
    409 call s:h("lessVariable", { "fg": s:purple })
    410 call s:h("lessAmpersandChar", { "fg": s:white })
    411 call s:h("lessClass", { "fg": s:dark_yellow })
    412 
    413 " Markdown (keep consistent with HTML, above)
    414 call s:h("markdownBlockquote", { "fg": s:comment_grey })
    415 call s:h("markdownBold", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" })
    416 call s:h("markdownCode", { "fg": s:green })
    417 call s:h("markdownCodeBlock", { "fg": s:green })
    418 call s:h("markdownCodeDelimiter", { "fg": s:green })
    419 call s:h("markdownH1", { "fg": s:red })
    420 call s:h("markdownH2", { "fg": s:red })
    421 call s:h("markdownH3", { "fg": s:red })
    422 call s:h("markdownH4", { "fg": s:red })
    423 call s:h("markdownH5", { "fg": s:red })
    424 call s:h("markdownH6", { "fg": s:red })
    425 call s:h("markdownHeadingDelimiter", { "fg": s:red })
    426 call s:h("markdownHeadingRule", { "fg": s:comment_grey })
    427 call s:h("markdownId", { "fg": s:purple })
    428 call s:h("markdownIdDeclaration", { "fg": s:blue })
    429 call s:h("markdownIdDelimiter", { "fg": s:purple })
    430 call s:h("markdownItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" })
    431 call s:h("markdownLinkDelimiter", { "fg": s:purple })
    432 call s:h("markdownLinkText", { "fg": s:blue })
    433 call s:h("markdownListMarker", { "fg": s:red })
    434 call s:h("markdownOrderedListMarker", { "fg": s:red })
    435 call s:h("markdownRule", { "fg": s:comment_grey })
    436 call s:h("markdownUrl", { "fg": s:cyan, "gui": "underline", "cterm": "underline" })
    437 
    438 " Perl
    439 call s:h("perlFiledescRead", { "fg": s:green })
    440 call s:h("perlFunction", { "fg": s:purple })
    441 call s:h("perlMatchStartEnd",{ "fg": s:blue })
    442 call s:h("perlMethod", { "fg": s:purple })
    443 call s:h("perlPOD", { "fg": s:comment_grey })
    444 call s:h("perlSharpBang", { "fg": s:comment_grey })
    445 call s:h("perlSpecialString",{ "fg": s:dark_yellow })
    446 call s:h("perlStatementFiledesc", { "fg": s:red })
    447 call s:h("perlStatementFlow",{ "fg": s:red })
    448 call s:h("perlStatementInclude", { "fg": s:purple })
    449 call s:h("perlStatementScalar",{ "fg": s:purple })
    450 call s:h("perlStatementStorage", { "fg": s:purple })
    451 call s:h("perlSubName",{ "fg": s:yellow })
    452 call s:h("perlVarPlain",{ "fg": s:blue })
    453 
    454 " PHP
    455 call s:h("phpVarSelector", { "fg": s:red })
    456 call s:h("phpOperator", { "fg": s:white })
    457 call s:h("phpParent", { "fg": s:white })
    458 call s:h("phpMemberSelector", { "fg": s:white })
    459 call s:h("phpType", { "fg": s:purple })
    460 call s:h("phpKeyword", { "fg": s:purple })
    461 call s:h("phpClass", { "fg": s:yellow })
    462 call s:h("phpUseClass", { "fg": s:white })
    463 call s:h("phpUseAlias", { "fg": s:white })
    464 call s:h("phpInclude", { "fg": s:purple })
    465 call s:h("phpClassExtends", { "fg": s:green })
    466 call s:h("phpDocTags", { "fg": s:white })
    467 call s:h("phpFunction", { "fg": s:blue })
    468 call s:h("phpFunctions", { "fg": s:cyan })
    469 call s:h("phpMethodsVar", { "fg": s:dark_yellow })
    470 call s:h("phpMagicConstants", { "fg": s:dark_yellow })
    471 call s:h("phpSuperglobals", { "fg": s:red })
    472 call s:h("phpConstants", { "fg": s:dark_yellow })
    473 
    474 " Ruby
    475 call s:h("rubyBlockParameter", { "fg": s:red})
    476 call s:h("rubyBlockParameterList", { "fg": s:red })
    477 call s:h("rubyClass", { "fg": s:purple})
    478 call s:h("rubyConstant", { "fg": s:yellow})
    479 call s:h("rubyControl", { "fg": s:purple })
    480 call s:h("rubyEscape", { "fg": s:red})
    481 call s:h("rubyFunction", { "fg": s:blue})
    482 call s:h("rubyGlobalVariable", { "fg": s:red})
    483 call s:h("rubyInclude", { "fg": s:blue})
    484 call s:h("rubyIncluderubyGlobalVariable", { "fg": s:red})
    485 call s:h("rubyInstanceVariable", { "fg": s:red})
    486 call s:h("rubyInterpolation", { "fg": s:cyan })
    487 call s:h("rubyInterpolationDelimiter", { "fg": s:red })
    488 call s:h("rubyInterpolationDelimiter", { "fg": s:red})
    489 call s:h("rubyRegexp", { "fg": s:cyan})
    490 call s:h("rubyRegexpDelimiter", { "fg": s:cyan})
    491 call s:h("rubyStringDelimiter", { "fg": s:green})
    492 call s:h("rubySymbol", { "fg": s:cyan})
    493 
    494 " Sass
    495 " https://github.com/tpope/vim-haml
    496 call s:h("sassAmpersand", { "fg": s:red })
    497 call s:h("sassClass", { "fg": s:dark_yellow })
    498 call s:h("sassControl", { "fg": s:purple })
    499 call s:h("sassExtend", { "fg": s:purple })
    500 call s:h("sassFor", { "fg": s:white })
    501 call s:h("sassFunction", { "fg": s:cyan })
    502 call s:h("sassId", { "fg": s:blue })
    503 call s:h("sassInclude", { "fg": s:purple })
    504 call s:h("sassMedia", { "fg": s:purple })
    505 call s:h("sassMediaOperators", { "fg": s:white })
    506 call s:h("sassMixin", { "fg": s:purple })
    507 call s:h("sassMixinName", { "fg": s:blue })
    508 call s:h("sassMixing", { "fg": s:purple })
    509 call s:h("sassVariable", { "fg": s:purple })
    510 " https://github.com/cakebaker/scss-syntax.vim
    511 call s:h("scssExtend", { "fg": s:purple })
    512 call s:h("scssImport", { "fg": s:purple })
    513 call s:h("scssInclude", { "fg": s:purple })
    514 call s:h("scssMixin", { "fg": s:purple })
    515 call s:h("scssSelectorName", { "fg": s:dark_yellow })
    516 call s:h("scssVariable", { "fg": s:purple })
    517 
    518 " TeX
    519 call s:h("texStatement", { "fg": s:purple })
    520 call s:h("texSubscripts", { "fg": s:dark_yellow })
    521 call s:h("texSuperscripts", { "fg": s:dark_yellow })
    522 call s:h("texTodo", { "fg": s:dark_red })
    523 call s:h("texBeginEnd", { "fg": s:purple })
    524 call s:h("texBeginEndName", { "fg": s:blue })
    525 call s:h("texMathMatcher", { "fg": s:blue })
    526 call s:h("texMathDelim", { "fg": s:blue })
    527 call s:h("texDelimiter", { "fg": s:dark_yellow })
    528 call s:h("texSpecialChar", { "fg": s:dark_yellow })
    529 call s:h("texCite", { "fg": s:blue })
    530 call s:h("texRefZone", { "fg": s:blue })
    531 
    532 " TypeScript
    533 call s:h("typescriptReserved", { "fg": s:purple })
    534 call s:h("typescriptEndColons", { "fg": s:white })
    535 call s:h("typescriptBraces", { "fg": s:white })
    536 
    537 " XML
    538 call s:h("xmlAttrib", { "fg": s:dark_yellow })
    539 call s:h("xmlEndTag", { "fg": s:red })
    540 call s:h("xmlTag", { "fg": s:red })
    541 call s:h("xmlTagName", { "fg": s:red })
    542 
    543 " }}}
    544 
    545 " Plugin Highlighting {{{
    546 
    547 " airblade/vim-gitgutter
    548 call s:h("GitGutterAdd", { "fg": s:green })
    549 call s:h("GitGutterChange", { "fg": s:yellow })
    550 call s:h("GitGutterDelete", { "fg": s:red })
    551 
    552 " dense-analysis/ale
    553 call s:h("ALEError", { "fg": s:red, "gui": "underline", "cterm": "underline" })
    554 call s:h("ALEWarning", { "fg": s:yellow, "gui": "underline", "cterm": "underline"})
    555 call s:h("ALEInfo", { "gui": "underline", "cterm": "underline"})
    556 
    557 " easymotion/vim-easymotion
    558 call s:h("EasyMotionTarget", { "fg": s:red, "gui": "bold", "cterm": "bold" })
    559 call s:h("EasyMotionTarget2First", { "fg": s:yellow, "gui": "bold", "cterm": "bold" })
    560 call s:h("EasyMotionTarget2Second", { "fg": s:dark_yellow, "gui": "bold", "cterm": "bold" })
    561 call s:h("EasyMotionShade",  { "fg": s:comment_grey })
    562 
    563 " lewis6991/gitsigns.nvim
    564 hi link GitSignsAdd    GitGutterAdd
    565 hi link GitSignsChange GitGutterChange
    566 hi link GitSignsDelete GitGutterDelete
    567 
    568 " mhinz/vim-signify
    569 hi link SignifySignAdd    GitGutterAdd
    570 hi link SignifySignChange GitGutterChange
    571 hi link SignifySignDelete GitGutterDelete
    572 
    573 " neoclide/coc.nvim
    574 call s:h("CocErrorSign", { "fg": s:red })
    575 call s:h("CocWarningSign", { "fg": s:yellow })
    576 call s:h("CocInfoSign", { "fg": s:blue })
    577 call s:h("CocHintSign", { "fg": s:cyan })
    578 
    579 " neomake/neomake
    580 call s:h("NeomakeErrorSign", { "fg": s:red })
    581 call s:h("NeomakeWarningSign", { "fg": s:yellow })
    582 call s:h("NeomakeInfoSign", { "fg": s:blue })
    583 
    584 " plasticboy/vim-markdown (keep consistent with Markdown, above)
    585 call s:h("mkdDelimiter", { "fg": s:purple })
    586 call s:h("mkdHeading", { "fg": s:red })
    587 call s:h("mkdLink", { "fg": s:blue })
    588 call s:h("mkdURL", { "fg": s:cyan, "gui": "underline", "cterm": "underline" })
    589 
    590 " prabirshrestha/vim-lsp
    591 call s:h("LspError", { "fg": s:red })
    592 call s:h("LspWarning", { "fg": s:yellow })
    593 call s:h("LspInformation", { "fg": s:blue })
    594 call s:h("LspHint", { "fg": s:cyan })
    595 
    596 " tpope/vim-fugitive
    597 call s:h("diffAdded", { "fg": s:green })
    598 call s:h("diffRemoved", { "fg": s:red })
    599 
    600 " }}}
    601 
    602 " Git Highlighting {{{
    603 
    604 call s:h("gitcommitComment", { "fg": s:comment_grey })
    605 call s:h("gitcommitUnmerged", { "fg": s:green })
    606 call s:h("gitcommitOnBranch", {})
    607 call s:h("gitcommitBranch", { "fg": s:purple })
    608 call s:h("gitcommitDiscardedType", { "fg": s:red })
    609 call s:h("gitcommitSelectedType", { "fg": s:green })
    610 call s:h("gitcommitHeader", {})
    611 call s:h("gitcommitUntrackedFile", { "fg": s:cyan })
    612 call s:h("gitcommitDiscardedFile", { "fg": s:red })
    613 call s:h("gitcommitSelectedFile", { "fg": s:green })
    614 call s:h("gitcommitUnmergedFile", { "fg": s:yellow })
    615 call s:h("gitcommitFile", {})
    616 call s:h("gitcommitSummary", { "fg": s:white })
    617 call s:h("gitcommitOverflow", { "fg": s:red })
    618 hi link gitcommitNoBranch gitcommitBranch
    619 hi link gitcommitUntracked gitcommitComment
    620 hi link gitcommitDiscarded gitcommitComment
    621 hi link gitcommitSelected gitcommitComment
    622 hi link gitcommitDiscardedArrow gitcommitDiscardedFile
    623 hi link gitcommitSelectedArrow gitcommitSelectedFile
    624 hi link gitcommitUnmergedArrow gitcommitUnmergedFile
    625 
    626 " }}}
    627 
    628 " Neovim-Specific Highlighting {{{
    629 
    630 if has("nvim")
    631   " Neovim terminal colors {{{
    632   let g:terminal_color_0 =  s:black.gui
    633   let g:terminal_color_1 =  s:red.gui
    634   let g:terminal_color_2 =  s:green.gui
    635   let g:terminal_color_3 =  s:yellow.gui
    636   let g:terminal_color_4 =  s:blue.gui
    637   let g:terminal_color_5 =  s:purple.gui
    638   let g:terminal_color_6 =  s:cyan.gui
    639   let g:terminal_color_7 =  s:white.gui
    640   let g:terminal_color_8 =  s:visual_grey.gui
    641   let g:terminal_color_9 =  s:dark_red.gui
    642   let g:terminal_color_10 = s:green.gui " No dark version
    643   let g:terminal_color_11 = s:dark_yellow.gui
    644   let g:terminal_color_12 = s:blue.gui " No dark version
    645   let g:terminal_color_13 = s:purple.gui " No dark version
    646   let g:terminal_color_14 = s:cyan.gui " No dark version
    647   let g:terminal_color_15 = s:comment_grey.gui
    648   let g:terminal_color_background = s:background.gui
    649   let g:terminal_color_foreground = s:foreground.gui
    650   " }}}
    651 
    652   " Neovim Diagnostics {{{
    653   call s:h("DiagnosticError", { "fg": s:red })
    654   call s:h("DiagnosticWarn", { "fg": s:yellow })
    655   call s:h("DiagnosticInfo", { "fg": s:blue })
    656   call s:h("DiagnosticHint", { "fg": s:cyan })
    657   call s:h("DiagnosticUnderlineError", { "fg": s:red, "gui": "underline", "cterm": "underline" })
    658   call s:h("DiagnosticUnderlineWarn", { "fg": s:yellow, "gui": "underline", "cterm": "underline" })
    659   call s:h("DiagnosticUnderlineInfo", { "fg": s:blue, "gui": "underline", "cterm": "underline" })
    660   call s:h("DiagnosticUnderlineHint", { "fg": s:cyan, "gui": "underline", "cterm": "underline" })
    661   " }}}
    662 
    663   " Neovim LSP (for versions < 0.5.1) {{{
    664   hi link LspDiagnosticsDefaultError DiagnosticError
    665   hi link LspDiagnosticsDefaultWarning DiagnosticWarn
    666   hi link LspDiagnosticsDefaultInformation DiagnosticInfo
    667   hi link LspDiagnosticsDefaultHint DiagnosticHint
    668   hi link LspDiagnosticsUnderlineError DiagnosticUnderlineError
    669   hi link LspDiagnosticsUnderlineWarning DiagnosticUnderlineWarn
    670   hi link LspDiagnosticsUnderlineInformation DiagnosticUnderlineInfo
    671   hi link LspDiagnosticsUnderlineHint DiagnosticUnderlineHint
    672   " }}}
    673 endif
    674 
    675 " }}}
    676 
    677 " Must appear at the end of the file to work around this oddity:
    678 " https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
    679 set background=dark