onedark.vim 30 KB

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