palenight.vim 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. " vim:fdm=marker
  2. " Vim Color File
  3. " Name: palenight.vim
  4. " Maintainer: https://github.com/drewtempelmeyer/palenight.vim
  5. " License: The MIT License (MIT)
  6. " Based On: https://github.com/joshdick/onedark.vim
  7. " Initialization {{{
  8. highlight clear
  9. if exists("syntax_on")
  10. syntax reset
  11. endif
  12. set t_Co=256
  13. let g:colors_name="palenight"
  14. " Set to "256" for 256-color terminals, or
  15. " set to "16" to use your terminal emulator's native colors
  16. " (a 16-color palette for this color scheme is available; see
  17. " < https://github.com/joshdick/onedark.vim/blob/master/README.md >
  18. " for more information.)
  19. if !exists("g:palenight_termcolors")
  20. let g:palenight_termcolors = 256
  21. endif
  22. " Not all terminals support italics properly. If yours does, opt-in.
  23. if !exists("g:palenight_terminal_italics")
  24. let g:palenight_terminal_italics = 0
  25. endif
  26. " This function is based on one from FlatColor: https://github.com/MaxSt/FlatColor/
  27. " Which in turn was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/
  28. function! s:h(group, style)
  29. if g:palenight_terminal_italics == 0
  30. if has_key(a:style, "cterm") && a:style["cterm"] == "italic"
  31. unlet a:style.cterm
  32. endif
  33. if has_key(a:style, "gui") && a:style["gui"] == "italic"
  34. unlet a:style.gui
  35. endif
  36. endif
  37. if g:palenight_termcolors == 16
  38. let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE")
  39. let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE")
  40. else
  41. let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE")
  42. let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE")
  43. endif
  44. execute "highlight" a:group
  45. \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
  46. \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE")
  47. \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE")
  48. \ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE")
  49. \ "ctermfg=" . l:ctermfg
  50. \ "ctermbg=" . l:ctermbg
  51. \ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE")
  52. endfunction
  53. " public {{{
  54. function! palenight#set_highlight(group, style)
  55. call s:h(a:group, a:style)
  56. endfunction
  57. " }}}
  58. " }}}
  59. " Color Variables {{{
  60. let s:colors = palenight#GetColors()
  61. let s:red = s:colors.red
  62. let s:light_red = s:colors.light_red
  63. let s:dark_red = s:colors.dark_red
  64. let s:green = s:colors.green
  65. let s:yellow = s:colors.yellow
  66. let s:dark_yellow = s:colors.dark_yellow
  67. let s:blue = s:colors.blue
  68. let s:purple = s:colors.purple
  69. let s:blue_purple = s:colors.blue_purple
  70. let s:cyan = s:colors.cyan
  71. let s:white = s:colors.white
  72. let s:black = s:colors.black
  73. let s:visual_black = s:colors.visual_black " Black out selected text in 16-color visual mode
  74. let s:comment_grey = s:colors.comment_grey
  75. let s:gutter_fg_grey = s:colors.gutter_fg_grey
  76. let s:cursor_grey = s:colors.cursor_grey
  77. let s:visual_grey = s:colors.visual_grey
  78. let s:menu_grey = s:colors.menu_grey
  79. let s:special_grey = s:colors.special_grey
  80. let s:vertsplit = s:colors.vertsplit
  81. let s:white_mask_3 = s:colors.white_mask_3
  82. " }}}
  83. " Syntax Groups (descriptions and ordering from `:h w18`) {{{
  84. call s:h("Comment", { "fg": s:comment_grey, "gui": "italic", "cterm": "italic" }) " any comment
  85. call s:h("Constant", { "fg": s:cyan }) " any constant
  86. call s:h("String", { "fg": s:green }) " a string constant: "this is a string"
  87. call s:h("Character", { "fg": s:green }) " a character constant: 'c', '\n'
  88. call s:h("Number", { "fg": s:dark_yellow }) " a number constant: 234, 0xff
  89. call s:h("Boolean", { "fg": s:red }) " a boolean constant: TRUE, false
  90. call s:h("Float", { "fg": s:dark_yellow }) " a floating point constant: 2.3e10
  91. call s:h("Identifier", { "fg": s:red }) " any variable name
  92. call s:h("Function", { "fg": s:blue }) " function name (also: methods for classes)
  93. call s:h("Statement", { "fg": s:purple }) " any statement
  94. call s:h("Conditional", { "fg": s:purple }) " if, then, else, endif, switch, etc.
  95. call s:h("Repeat", { "fg": s:purple }) " for, do, while, etc.
  96. call s:h("Label", { "fg": s:purple }) " case, default, etc.
  97. call s:h("Operator", { "fg": s:cyan }) " sizeof", "+", "*", etc.
  98. call s:h("Keyword", { "fg": s:red }) " any other keyword
  99. call s:h("Exception", { "fg": s:purple }) " try, catch, throw
  100. call s:h("PreProc", { "fg": s:yellow }) " generic Preprocessor
  101. call s:h("Include", { "fg": s:blue }) " preprocessor #include
  102. call s:h("Define", { "fg": s:purple }) " preprocessor #define
  103. call s:h("Macro", { "fg": s:purple }) " same as Define
  104. call s:h("PreCondit", { "fg": s:yellow }) " preprocessor #if, #else, #endif, etc.
  105. call s:h("Type", { "fg": s:yellow }) " int, long, char, etc.
  106. call s:h("StorageClass", { "fg": s:yellow }) " static, register, volatile, etc.
  107. call s:h("Structure", { "fg": s:yellow }) " struct, union, enum, etc.
  108. call s:h("Typedef", { "fg": s:yellow }) " A typedef
  109. call s:h("Special", { "fg": s:blue }) " any special symbol
  110. call s:h("SpecialChar", {}) " special character in a constant
  111. call s:h("Tag", {}) " you can use CTRL-] on this
  112. call s:h("Delimiter", {}) " character that needs attention
  113. call s:h("SpecialComment", { "fg": s:comment_grey }) " special things inside a comment
  114. call s:h("Debug", {}) " debugging statements
  115. call s:h("Underlined", { "gui": "underline", "cterm": "underline" }) " text that stands out, HTML links
  116. call s:h("Ignore", {}) " left blank, hidden
  117. call s:h("Error", { "fg": s:red }) " any erroneous construct
  118. call s:h("Todo", { "fg": s:purple }) " anything that needs extra attention; mostly the keywords TODO FIXME and XXX
  119. " }}}
  120. " Highlighting Groups (descriptions and ordering from `:h hitest.vim`) {{{
  121. call s:h("ColorColumn", { "bg": s:cursor_grey }) " used for the columns set with 'colorcolumn'
  122. call s:h("Conceal", {}) " placeholder characters substituted for concealed text (see 'conceallevel')
  123. call s:h("Cursor", { "fg": s:black, "bg": s:blue }) " the character under the cursor
  124. call s:h("CursorIM", {}) " like Cursor, but used when in IME mode
  125. call s:h("CursorColumn", { "bg": s:cursor_grey }) " the screen column that the cursor is in when 'cursorcolumn' is set
  126. call s:h("CursorLine", { "bg": s:cursor_grey }) " the screen line that the cursor is in when 'cursorline' is set
  127. call s:h("Directory", { "fg": s:blue }) " directory names (and other special names in listings)
  128. call s:h("DiffAdd", { "bg": s:green, "fg": s:black }) " diff mode: Added line
  129. call s:h("DiffChange", { "bg": s:yellow, "fg": s:black }) " diff mode: Changed line
  130. call s:h("DiffDelete", { "bg": s:red, "fg": s:black }) " diff mode: Deleted line
  131. call s:h("DiffText", { "bg": s:black, "fg": s:yellow }) " diff mode: Changed text within a changed line
  132. call s:h("ErrorMsg", { "fg": s:red }) " error messages on the command line
  133. call s:h("VertSplit", { "fg": s:vertsplit }) " the column separating vertically split windows
  134. call s:h("Folded", { "bg": s:cursor_grey, "fg": s:comment_grey }) " line used for closed folds
  135. call s:h("FoldColumn", {}) " 'foldcolumn'
  136. call s:h("SignColumn", {}) " column where signs are displayed
  137. call s:h("IncSearch", { "fg": s:yellow, "bg": s:comment_grey }) " 'incsearch' highlighting; also used for the text replaced with ":s///c"
  138. call s:h("LineNr", { "fg": s:gutter_fg_grey }) " Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
  139. call s:h("CursorLineNr", {}) " Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
  140. call s:h("MatchParen", { "fg": s:blue, "gui": "underline" }) " The character under the cursor or just before it, if it is a paired bracket, and its match.
  141. call s:h("ModeMsg", {}) " 'showmode' message (e.g., "-- INSERT --")
  142. call s:h("MoreMsg", {}) " more-prompt
  143. 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).
  144. call s:h("Normal", { "fg": s:white, "bg": s:black }) " normal text
  145. call s:h("Pmenu", { "bg": s:menu_grey }) " Popup menu: normal item.
  146. call s:h("PmenuSel", { "fg": s:black, "bg": s:blue }) " Popup menu: selected item.
  147. call s:h("PmenuSbar", { "bg": s:special_grey }) " Popup menu: scrollbar.
  148. call s:h("PmenuThumb", { "bg": s:white }) " Popup menu: Thumb of the scrollbar.
  149. call s:h("Question", { "fg": s:purple }) " hit-enter prompt and yes/no questions
  150. call s:h("Search", { "fg": s:black, "bg": s:yellow }) " Last search pattern highlighting (see 'hlsearch'). Also used for highlighting the current line in the quickfix window and similar items that need to stand out.
  151. 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.
  152. 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.
  153. call s:h("SpellCap", { "fg": s:dark_yellow }) " Word that should start with a capital. This will be combined with the highlighting used otherwise.
  154. 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.
  155. 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.
  156. call s:h("StatusLine", { "fg": s:white, "bg": s:cursor_grey }) " status line of current window
  157. 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.
  158. call s:h("TabLine", { "fg": s:comment_grey }) " tab pages line, not active tab page label
  159. call s:h("TabLineFill", {}) " tab pages line, where there are no labels
  160. call s:h("TabLineSel", { "fg": s:white }) " tab pages line, active tab page label
  161. call s:h("Title", { "fg": s:green }) " titles for output from ":set all", ":autocmd" etc.
  162. call s:h("Visual", { "fg": s:visual_black, "bg": s:visual_grey }) " Visual mode selection
  163. 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.
  164. call s:h("WarningMsg", { "fg": s:yellow }) " warning messages
  165. call s:h("WildMenu", { "fg": s:black, "bg": s:blue }) " current match in 'wildmenu' completion
  166. " }}}
  167. " Language-Specific Highlighting {{{
  168. " Dockerfile
  169. call s:h("dockerfileKeyword", { "fg": s:purple })
  170. " Shell
  171. call s:h("shSet", { "fg": s:cyan })
  172. call s:h("shSetOption", { "fg": s:white })
  173. call s:h("shStatement", { "fg": s:cyan })
  174. call s:h("shFunctionKey", { "fg": s:purple })
  175. " CSS
  176. call s:h("cssAttrComma", { "fg": s:purple })
  177. call s:h("cssAttributeSelector", { "fg": s:green })
  178. call s:h("cssBraces", { "fg": s:white })
  179. call s:h("cssClassName", { "fg": s:dark_yellow })
  180. call s:h("cssClassNameDot", { "fg": s:dark_yellow })
  181. call s:h("cssDefinition", { "fg": s:purple })
  182. call s:h("cssFontAttr", { "fg": s:dark_yellow })
  183. call s:h("cssFontDescriptor", { "fg": s:purple })
  184. call s:h("cssFunctionName", { "fg": s:blue })
  185. call s:h("cssIdentifier", { "fg": s:blue })
  186. call s:h("cssImportant", { "fg": s:purple })
  187. call s:h("cssInclude", { "fg": s:white })
  188. call s:h("cssIncludeKeyword", { "fg": s:purple })
  189. call s:h("cssMediaType", { "fg": s:dark_yellow })
  190. call s:h("cssProp", { "fg": s:white })
  191. call s:h("cssPseudoClassId", { "fg": s:dark_yellow })
  192. call s:h("cssSelectorOp", { "fg": s:purple })
  193. call s:h("cssSelectorOp2", { "fg": s:purple })
  194. call s:h("cssTagName", { "fg": s:red })
  195. " Go
  196. call s:h("goDeclaration", { "fg": s:purple })
  197. " HTML
  198. call s:h("htmlTitle", { "fg": s:white })
  199. call s:h("htmlArg", { "fg": s:yellow })
  200. call s:h("htmlEndTag", { "fg": s:cyan })
  201. call s:h("htmlH1", { "fg": s:white })
  202. call s:h("htmlLink", { "fg": s:purple })
  203. call s:h("htmlSpecialChar", { "fg": s:dark_yellow })
  204. call s:h("htmlSpecialTagName", { "fg": s:red })
  205. call s:h("htmlTag", { "fg": s:cyan })
  206. call s:h("htmlTagName", { "fg": s:red })
  207. " Coffeescript
  208. call s:h("coffeeExtendedOp", { "fg": s:purple })
  209. " JavaScript
  210. call s:h("javaScriptBraces", { "fg": s:white })
  211. call s:h("javaScriptFunction", { "fg": s:purple })
  212. call s:h("javaScriptIdentifier", { "fg": s:purple })
  213. call s:h("javaScriptNull", { "fg": s:dark_yellow })
  214. call s:h("javaScriptNumber", { "fg": s:dark_yellow })
  215. call s:h("javaScriptRequire", { "fg": s:cyan })
  216. call s:h("javaScriptReserved", { "fg": s:purple })
  217. " https://github.com/pangloss/vim-javascript
  218. call s:h("jsArrowFunction", { "fg": s:purple })
  219. call s:h("jsClassKeyword", { "fg": s:purple })
  220. call s:h("jsClassDefinition", { "fg": s:yellow })
  221. call s:h("jsClassMethodType", { "fg": s:purple })
  222. call s:h("jsClassFuncName", { "fg": s:blue })
  223. call s:h("jsDestructuringBlock", { "fg": s:blue })
  224. call s:h("jsDocParam", { "fg": s:blue })
  225. call s:h("jsDocTags", { "fg": s:purple })
  226. call s:h("jsExport", { "fg": s:purple })
  227. call s:h("jsExportDefault", { "fg": s:red })
  228. call s:h("jsExtendsKeyword", { "fg": s:purple })
  229. call s:h("jsConditional", { "fg": s:purple })
  230. call s:h("jsOperator", { "fg": s:purple })
  231. call s:h("jsFrom", { "fg": s:purple })
  232. call s:h("jsFuncArgs", { "fg": s:blue })
  233. call s:h("jsFuncCall", { "fg": s:blue })
  234. call s:h("jsFuncName", { "fg": s:blue })
  235. call s:h("jsObjectProp", { "fg": s:cyan })
  236. call s:h("jsFunction", { "fg": s:purple })
  237. call s:h("jsGenerator", { "fg": s:yellow })
  238. call s:h("jsGlobalObjects", { "fg": s:yellow })
  239. call s:h("jsImport", { "fg": s:purple })
  240. call s:h("jsModuleAs", { "fg": s:purple })
  241. call s:h("jsModuleWords", { "fg": s:purple })
  242. call s:h("jsModuleKeyword", { "fg": s:blue })
  243. call s:h("jsModules", { "fg": s:purple })
  244. call s:h("jsNull", { "fg": s:dark_yellow })
  245. call s:h("jsStorageClass", { "fg": s:purple })
  246. call s:h("jsSuper", { "fg": s:red })
  247. call s:h("jsTemplateBraces", { "fg": s:dark_red })
  248. call s:h("jsTemplateVar", { "fg": s:green })
  249. call s:h("jsThis", { "fg": s:red })
  250. call s:h("jsUndefined", { "fg": s:dark_yellow })
  251. " call s:h("jsVariableDef", { "fg": s:blue })
  252. " https://github.com/othree/yajs.vim
  253. call s:h("javascriptArrowFunc", { "fg": s:purple })
  254. call s:h("javascriptClassExtends", { "fg": s:purple })
  255. call s:h("javascriptClassKeyword", { "fg": s:purple })
  256. call s:h("javascriptDocNotation", { "fg": s:purple })
  257. call s:h("javascriptDocParamName", { "fg": s:blue })
  258. call s:h("javascriptDocTags", { "fg": s:purple })
  259. call s:h("javascriptEndColons", { "fg": s:white })
  260. call s:h("javascriptExport", { "fg": s:purple })
  261. call s:h("javascriptFuncArg", { "fg": s:white })
  262. call s:h("javascriptFuncKeyword", { "fg": s:purple })
  263. call s:h("javascriptIdentifier", { "fg": s:red })
  264. call s:h("javascriptImport", { "fg": s:purple })
  265. call s:h("javascriptMethodName", { "fg": s:white })
  266. call s:h("javascriptObjectLabel", { "fg": s:white })
  267. call s:h("javascriptOpSymbol", { "fg": s:cyan })
  268. call s:h("javascriptOpSymbols", { "fg": s:cyan })
  269. call s:h("javascriptPropertyName", { "fg": s:green })
  270. call s:h("javascriptTemplateSB", { "fg": s:dark_red })
  271. call s:h("javascriptVariable", { "fg": s:purple })
  272. " JSON
  273. call s:h("jsonCommentError", { "fg": s:white })
  274. call s:h("jsonKeyword", { "fg": s:blue })
  275. call s:h("jsonBoolean", { "fg": s:red })
  276. call s:h("jsonNumber", { "fg": s:dark_yellow })
  277. call s:h("jsonQuote", { "fg": s:white })
  278. call s:h("jsonMissingCommaError", { "fg": s:red, "gui": "reverse" })
  279. call s:h("jsonNoQuotesError", { "fg": s:red, "gui": "reverse" })
  280. call s:h("jsonNumError", { "fg": s:red, "gui": "reverse" })
  281. call s:h("jsonString", { "fg": s:green })
  282. call s:h("jsonStringSQError", { "fg": s:red, "gui": "reverse" })
  283. call s:h("jsonSemicolonError", { "fg": s:red, "gui": "reverse" })
  284. " Markdown
  285. call s:h("markdownCode", { "fg": s:green })
  286. call s:h("markdownLinkReference", { "fg": s:comment_grey })
  287. call s:h("markdownJekyllFrontMatter", { "fg": s:comment_grey })
  288. call s:h("markdownCodeBlock", { "fg": s:green })
  289. call s:h("markdownCodeDelimiter", { "fg": s:green })
  290. call s:h("markdownHeadingDelimiter", { "fg": s:red })
  291. call s:h("markdownRule", { "fg": s:comment_grey })
  292. call s:h("markdownHeadingRule", { "fg": s:comment_grey })
  293. call s:h("htmlH1", { "fg": s:blue })
  294. call s:h("htmlH2", { "fg": s:blue })
  295. call s:h("htmlH3", { "fg": s:blue })
  296. call s:h("htmlH4", { "fg": s:blue })
  297. call s:h("htmlH5", { "fg": s:blue })
  298. call s:h("htmlH6", { "fg": s:blue })
  299. call s:h("mkdDelimiter", { "fg": s:cyan })
  300. call s:h("markdownId", { "fg": s:purple })
  301. call s:h("markdownBlockquote", { "fg": s:comment_grey })
  302. call s:h("markdownItalic", { "fg": s:purple, "gui": "italic", "cterm": "italic" })
  303. call s:h("mkdBold", { "fg": s:yellow, "gui": "bold", "cterm": "bold" })
  304. call s:h("mkdInlineURL", { "fg": s:light_red })
  305. call s:h("mkdListItem", { "fg": s:yellow })
  306. call s:h("markdownOrderedListMarker", { "fg": s:red })
  307. call s:h("markdownIdDeclaration", { "fg": s:blue })
  308. call s:h("mkdLink", { "fg": s:white })
  309. call s:h("markdownLinkDelimiter", { "fg": s:white })
  310. call s:h("mkdURL", { "fg": s:light_red })
  311. " Ruby
  312. call s:h("rubyAccess", { "fg": s:cyan })
  313. call s:h("rubyBlockParameter", { "fg": s:yellow})
  314. call s:h("rubyBlockParameterList", { "fg": s:white })
  315. call s:h("rubyBoolean", { "fg": s:red })
  316. call s:h("rubyCapitalizedMethod", { "fg": s:blue})
  317. call s:h("rubyClass", { "fg": s:purple})
  318. call s:h("rubyClassName", { "fg": s:yellow })
  319. call s:h("rubyConstant", { "fg": s:yellow })
  320. call s:h("rubyControl", { "fg": s:purple })
  321. call s:h("rubyEscape", { "fg": s:red})
  322. call s:h("rubyFunction", { "fg": s:blue})
  323. call s:h("rubyGlobalVariable", { "fg": s:red})
  324. call s:h("rubyInclude", { "fg": s:cyan})
  325. call s:h("rubyIncluderubyGlobalVariable", { "fg": s:red})
  326. call s:h("rubyInstanceVariable", { "fg": s:red})
  327. call s:h("rubyInterpolation", { "fg": s:cyan })
  328. call s:h("rubyInterpolationDelimiter", { "fg": s:red })
  329. call s:h("rubyModuleName", { "fg": s:white })
  330. call s:h("rubyKeyword", { "fg": s:purple })
  331. call s:h("rubyKeywordAsMethod", { "fg": s:cyan})
  332. call s:h("rubyOperator", { "fg": s:purple })
  333. call s:h("rubyPredefinedConstant", { "fg": s:yellow})
  334. call s:h("rubyPseudoVariable", { "fg": s:blue })
  335. call s:h("rubyRegexp", { "fg": s:white})
  336. call s:h("rubyRegexpDelimiter", { "fg": s:cyan})
  337. call s:h("rubySharpBang", { "fg": s:comment_grey})
  338. call s:h("rubyStringDelimiter", { "fg": s:green})
  339. call s:h("rubySymbol", { "fg": s:blue})
  340. " ERb
  341. call s:h("erubyDelimiter", { "fg": s:red })
  342. " Rails
  343. call s:h("railsAssetPreProc", { "fg": s:comment_grey })
  344. call s:h("railsAssetInclude", { "fg": s:comment_grey })
  345. call s:h("railsAssetIncluded", { "fg": s:comment_grey })
  346. call s:h("rubyRailsMethod", { "fg": s:blue })
  347. call s:h("rubyRailsFilterMethod", { "fg": s:cyan })
  348. call s:h("rubyRailsRenderMethod", { "fg": s:cyan })
  349. call s:h("rubyRailsARAssociationMethod", { "fg": s:cyan })
  350. call s:h("rubyRailsHelperMethod", { "fg": s:cyan })
  351. " RSpec
  352. call s:h("rspecGroupMethods", { "fg": s:white })
  353. call s:h("rspecBeforeAndAfter", { "fg": s:white })
  354. " CSS
  355. call s:h("cssColor", { "fg": s:dark_yellow })
  356. call s:h("cssCommonAttr", { "fg": s:blue })
  357. call s:h("cssProp", { "fg": s:cyan })
  358. call s:h("cssSelectorOp", { "fg": s:white })
  359. call s:h("cssUnitDecorators", { "fg": s:yellow })
  360. " Sass
  361. " https://github.com/tpope/vim-haml
  362. call s:h("sassAmpersand", { "fg": s:red })
  363. call s:h("sassClass", { "fg": s:dark_yellow })
  364. call s:h("sassControl", { "fg": s:purple })
  365. call s:h("sassExtend", { "fg": s:purple })
  366. call s:h("sassFor", { "fg": s:white })
  367. call s:h("sassFunction", { "fg": s:cyan })
  368. call s:h("sassId", { "fg": s:blue })
  369. call s:h("sassInclude", { "fg": s:purple })
  370. call s:h("sassMedia", { "fg": s:purple })
  371. call s:h("sassMediaOperators", { "fg": s:white })
  372. call s:h("sassMixin", { "fg": s:purple })
  373. call s:h("sassMixinName", { "fg": s:blue })
  374. call s:h("sassMixing", { "fg": s:purple })
  375. call s:h("sassVariable", { "fg": s:dark_yellow })
  376. " https://github.com/cakebaker/scss-syntax.vim
  377. call s:h("scssExtend", { "fg": s:purple })
  378. call s:h("scssExtendedSelector", { "fg": s:dark_yellow })
  379. call s:h("scssFunctionName", { "fg": s:cyan })
  380. call s:h("scssImport", { "fg": s:purple })
  381. call s:h("scssInclude", { "fg": s:purple })
  382. call s:h("scssMixin", { "fg": s:purple })
  383. call s:h("scssMixinName", { "fg": s:blue })
  384. call s:h("scssSelectorName", { "fg": s:yellow })
  385. call s:h("scssVariable", { "fg": s:dark_yellow })
  386. " TypeScript
  387. call s:h("typescriptReserved", { "fg": s:purple })
  388. call s:h("typescriptEndColons", { "fg": s:white })
  389. call s:h("typescriptBraces", { "fg": s:white })
  390. " XML
  391. call s:h("xmlAttrib", { "fg": s:yellow })
  392. call s:h("xmlEndTag", { "fg": s:red })
  393. call s:h("xmlTag", { "fg": s:red })
  394. call s:h("xmlTagName", { "fg": s:red })
  395. " PHP
  396. call s:h("phpInclude", { "fg": s:purple })
  397. call s:h("phpClass", { "fg": s:yellow })
  398. call s:h("phpClasses", { "fg": s:yellow })
  399. call s:h("phpFunction", { "fg": s:blue })
  400. call s:h("phpType", { "fg": s:purple })
  401. call s:h("phpKeyword", { "fg": s:purple })
  402. call s:h("phpVarSelector", { "fg": s:white })
  403. call s:h("phpIdentifier", { "fg": s:white })
  404. call s:h("phpMethod", { "fg": s:blue })
  405. call s:h("phpBoolean", { "fg": s:blue })
  406. call s:h("phpParent", { "fg": s:white })
  407. call s:h("phpOperator", { "fg": s:purple })
  408. call s:h("phpRegion", { "fg": s:purple })
  409. call s:h("phpUseNamespaceSeparator", { "fg": s:white })
  410. call s:h("phpClassNamespaceSeparator", { "fg": s:white })
  411. call s:h("phpDocTags", { "fg": s:purple, "gui": "italic", "cterm": "italic" })
  412. call s:h("phpDocParam", { "fg": s:purple, "gui": "italic", "cterm": "italic" })
  413. " Dart
  414. call s:h("dartLibrary", { "fg": s:purple})
  415. call s:h("dartTypedef", { "fg": s:purple})
  416. call s:h("dartClassDecl", { "fg": s:purple})
  417. call s:h("dartCoreType", { "fg": s:purple})
  418. call s:h("dartStorageClass", { "fg": s:purple})
  419. call s:h("dartOperator", { "fg": s:purple})
  420. call s:h("dartMetadata", { "fg": s:purple})
  421. call s:h("dartKeyword", { "fg": s:purple})
  422. " }}}
  423. " Plugin Highlighting {{{
  424. " airblade/vim-gitgutter
  425. hi link GitGutterAdd SignifySignAdd
  426. hi link GitGutterChange SignifySignChange
  427. hi link GitGutterDelete SignifySignDelete
  428. " mhinz/vim-signify
  429. call s:h("SignifySignAdd", { "fg": s:green })
  430. call s:h("SignifySignChange", { "fg": s:yellow })
  431. call s:h("SignifySignDelete", { "fg": s:red })
  432. " neomake/neomake
  433. call s:h("NeomakeWarningSign", { "fg": s:yellow })
  434. call s:h("NeomakeErrorSign", { "fg": s:red })
  435. call s:h("NeomakeInfoSign", { "fg": s:blue })
  436. " tpope/vim-fugitive
  437. call s:h("diffAdded", { "fg": s:green })
  438. call s:h("diffRemoved", { "fg": s:red })
  439. " liuchengxu/vista.vim
  440. call s:h("VistaBracket", { "fg": s:purple })
  441. call s:h("VistaChildrenNr", { "fg": s:dark_yellow })
  442. call s:h("VistaScope", { "fg": s:blue_purple })
  443. call s:h("VistaTag", { "fg": s:purple })
  444. call s:h("VistaPrefix", { "fg": s:blue_purple })
  445. call s:h("VistaParenthesis", { "fg": s:purple })
  446. call s:h("VistaColon", { "fg": s:cyan })
  447. call s:h("VistaIcon", { "fg": s:cyan })
  448. call s:h("VistaLineNr", { "fg": s:comment_grey })
  449. call s:h("VistaArgs", { "fg": s:comment_grey })
  450. call s:h("VistaKind", { "fg": s:comment_grey })
  451. call s:h("VistaScopeKind", { "fg": s:yellow })
  452. " termdebug
  453. call s:h("debugBreakpoint", { "fg": s:blue_purple })
  454. call s:h("debugPC", { "bg": s:blue_purple, "fg": s:black })
  455. " davidhalter/jedi-vim
  456. call s:h("jediFunction", { "bg": s:white_mask_3, "fg": s:white })
  457. call s:h("jediFat", { "bg": s:white_mask_3, "fg": s:blue , "gui": "bold,underline" })
  458. " }}}
  459. " Git Highlighting {{{
  460. call s:h("gitcommitComment", { "fg": s:comment_grey })
  461. call s:h("gitcommitUnmerged", { "fg": s:green })
  462. call s:h("gitcommitOnBranch", {})
  463. call s:h("gitcommitBranch", { "fg": s:purple })
  464. call s:h("gitcommitDiscardedType", { "fg": s:red })
  465. call s:h("gitcommitSelectedType", { "fg": s:green })
  466. call s:h("gitcommitHeader", {})
  467. call s:h("gitcommitUntrackedFile", { "fg": s:cyan })
  468. call s:h("gitcommitDiscardedFile", { "fg": s:red })
  469. call s:h("gitcommitSelectedFile", { "fg": s:green })
  470. call s:h("gitcommitUnmergedFile", { "fg": s:yellow })
  471. call s:h("gitcommitFile", {})
  472. call s:h("gitcommitSummary", { "fg": s:white })
  473. call s:h("gitcommitOverflow", { "fg": s:red })
  474. hi link gitcommitNoBranch gitcommitBranch
  475. hi link gitcommitUntracked gitcommitComment
  476. hi link gitcommitDiscarded gitcommitComment
  477. hi link gitcommitSelected gitcommitComment
  478. hi link gitcommitDiscardedArrow gitcommitDiscardedFile
  479. hi link gitcommitSelectedArrow gitcommitSelectedFile
  480. hi link gitcommitUnmergedArrow gitcommitUnmergedFile
  481. " }}}
  482. " Setup Terminal Colors {{{
  483. if has("nvim")
  484. let g:terminal_color_0 = s:black.gui
  485. let g:terminal_color_1 = s:red.gui
  486. let g:terminal_color_2 = s:green.gui
  487. let g:terminal_color_3 = s:yellow.gui
  488. let g:terminal_color_4 = s:blue.gui
  489. let g:terminal_color_5 = s:purple.gui
  490. let g:terminal_color_6 = s:cyan.gui
  491. let g:terminal_color_7 = s:white.gui
  492. let g:terminal_color_8 = s:visual_grey.gui
  493. let g:terminal_color_9 = s:dark_red.gui
  494. let g:terminal_color_10 = s:green.gui " No dark version
  495. let g:terminal_color_11 = s:dark_yellow.gui
  496. let g:terminal_color_12 = s:blue.gui " No dark version
  497. let g:terminal_color_13 = s:purple.gui " No dark version
  498. let g:terminal_color_14 = s:cyan.gui " No dark version
  499. let g:terminal_color_15 = s:comment_grey.gui
  500. let g:terminal_color_background = g:terminal_color_0
  501. let g:terminal_color_foreground = g:terminal_color_7
  502. elseif has('terminal')
  503. let g:terminal_ansi_colors = [
  504. \ s:black.gui,
  505. \ s:red.gui,
  506. \ s:green.gui,
  507. \ s:yellow.gui,
  508. \ s:blue.gui,
  509. \ s:purple.gui,
  510. \ s:cyan.gui,
  511. \ s:white.gui,
  512. \ s:visual_grey.gui,
  513. \ s:dark_red.gui,
  514. \ s:green.gui,
  515. \ s:dark_yellow.gui,
  516. \ s:blue.gui,
  517. \ s:purple.gui,
  518. \ s:cyan.gui,
  519. \ s:white.gui
  520. \ ]
  521. endif
  522. " }}}
  523. " Must appear at the end of the file to work around this oddity:
  524. " https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
  525. set background=dark