gruvbox.vim 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. " -----------------------------------------------------------------------------
  2. " File: gruvbox.vim
  3. " Description: Retro groove color scheme for Vim
  4. " Author: morhetz <morhetz@gmail.com>
  5. " Source: https://github.com/morhetz/gruvbox
  6. " Last Modified: 10 Nov 2014
  7. " -----------------------------------------------------------------------------
  8. " Supporting code -------------------------------------------------------------
  9. " Initialisation: {{{
  10. if version > 580
  11. hi clear
  12. if exists("syntax_on")
  13. syntax reset
  14. endif
  15. endif
  16. let g:colors_name='gruvbox'
  17. if !has('gui_running') && &t_Co != 256
  18. finish
  19. endif
  20. " }}}
  21. " Global Settings: {{{
  22. if !exists('g:gruvbox_bold')
  23. let g:gruvbox_bold=1
  24. endif
  25. if !exists('g:gruvbox_italic')
  26. if has('gui_running') || $TERM_ITALICS == 'true'
  27. let g:gruvbox_italic=1
  28. else
  29. let g:gruvbox_italic=0
  30. endif
  31. endif
  32. if !exists('g:gruvbox_undercurl')
  33. let g:gruvbox_undercurl=1
  34. endif
  35. if !exists('g:gruvbox_underline')
  36. let g:gruvbox_underline=1
  37. endif
  38. if !exists('g:gruvbox_guisp_fallback') || index(['fg', 'bg'], g:gruvbox_guisp_fallback) == -1
  39. let g:gruvbox_guisp_fallback='none'
  40. endif
  41. if !exists('g:gruvbox_italicize_comments')
  42. let g:gruvbox_italicize_comments=1
  43. endif
  44. if !exists('g:gruvbox_italicize_strings')
  45. let g:gruvbox_italicize_strings=0
  46. endif
  47. if !exists('g:gruvbox_improved_strings')
  48. let g:gruvbox_improved_strings=0
  49. endif
  50. if !exists('g:gruvbox_improved_warnings')
  51. let g:gruvbox_improved_warnings=0
  52. endif
  53. if !exists('g:gruvbox_termcolors')
  54. let g:gruvbox_termcolors=256
  55. endif
  56. if !exists('g:gruvbox_invert_indent_guides')
  57. let g:gruvbox_invert_indent_guides=0
  58. endif
  59. if !exists('g:gruvbox_hls_cursor')
  60. let g:gruvbox_hls_cursor='orange'
  61. endif
  62. if !exists('g:gruvbox_sign_column')
  63. let g:gruvbox_sign_column='dark1'
  64. endif
  65. if !exists('g:gruvbox_color_column')
  66. let g:gruvbox_color_column='dark1'
  67. endif
  68. if !exists('g:gruvbox_vert_split')
  69. let g:gruvbox_vert_split='dark2'
  70. endif
  71. if !exists('g:gruvbox_invert_signs')
  72. let g:gruvbox_invert_signs=0
  73. endif
  74. if !exists('g:gruvbox_invert_selection')
  75. let g:gruvbox_invert_selection=1
  76. endif
  77. if !exists('g:gruvbox_contrast')
  78. let g:gruvbox_contrast='medium'
  79. endif
  80. if !exists('g:gruvbox_contrast_dark')
  81. let g:gruvbox_contrast_dark='medium'
  82. endif
  83. if !exists('g:gruvbox_contrast_light')
  84. let g:gruvbox_contrast_light='medium'
  85. endif
  86. if !exists('g:gruvbox_invert_tabline')
  87. let g:gruvbox_invert_tabline=0
  88. endif
  89. let s:is_dark=(&background == 'dark')
  90. " }}}
  91. " Palette: {{{
  92. let s:gb = {}
  93. if s:is_dark
  94. let s:gb.dark0 = ['282828', 235] " 40-40-40
  95. let s:gb.dark1 = ['3c3836', 237] " 60-56-54
  96. let s:gb.dark2 = ['504945', 239] " 80-73-69
  97. let s:gb.dark3 = ['665c54', 241] " 102-92-84
  98. let s:gb.dark4 = ['7c6f64', 243] " 124-111-100
  99. let s:gb.medium = ['928374', 245] " 146-131-116
  100. let s:gb.light0 = ['fdf4c1', 229] " 253-244-193
  101. let s:gb.light1 = ['ebdbb2', 223] " 235-219-178
  102. let s:gb.light2 = ['d5c4a1', 250] " 213-196-161
  103. let s:gb.light3 = ['bdae93', 248] " 189-174-147
  104. let s:gb.light4 = ['a89984', 246] " 168-153-132
  105. let s:gb.light4_256 = ['a89984', 246] " 168-153-132
  106. let s:gb.red = ['fb4934', 167] " 251-73-52
  107. let s:gb.green = ['b8bb26', 142] " 184-187-38
  108. let s:gb.yellow = ['fabd2f', 214] " 250-189-47
  109. let s:gb.blue = ['83a598', 109] " 131-165-152
  110. let s:gb.purple = ['d3869b', 175] " 211-134-155
  111. let s:gb.aqua = ['8ec07c', 108] " 142-192-124
  112. let s:gb.orange = ['fe8019', 208] " 254-128-25
  113. if g:gruvbox_termcolors == 16
  114. let s:gb.dark0 = ['282828', 0]
  115. let s:gb.light4 = ['a89984', 7]
  116. let s:gb.medium = ['928374', 8]
  117. let s:gb.red = ['fb4934', 9]
  118. let s:gb.green = ['b8bb26', 10]
  119. let s:gb.yellow = ['fabd2f', 11]
  120. let s:gb.blue = ['83a598', 12]
  121. let s:gb.purple = ['d3869b', 13]
  122. let s:gb.aqua = ['8ec07c', 14]
  123. let s:gb.light1 = ['ebdbb2', 15]
  124. endif
  125. if g:gruvbox_contrast == 'soft'
  126. let s:gb.dark0 = ['32302f', 236] " 50-48-47
  127. endif
  128. if g:gruvbox_contrast == 'hard'
  129. let s:gb.dark0 = ['1d2021', 234] " 29-32-33
  130. endif
  131. if g:gruvbox_contrast_dark == 'soft'
  132. let s:gb.dark0 = ['32302f', 236] " 50-48-47
  133. endif
  134. if g:gruvbox_contrast_dark == 'hard'
  135. let s:gb.dark0 = ['1d2021', 234] " 29-32-33
  136. endif
  137. else
  138. let s:gb.dark0 = ['fbf1c7', 229] " 251-241-199
  139. let s:gb.dark1 = ['ebdbb2', 223] " 235-219-178
  140. let s:gb.dark2 = ['d5c4a1', 250] " 213-196-161
  141. let s:gb.dark3 = ['bdae93', 248] " 189-174-147
  142. let s:gb.dark4 = ['a89984', 246] " 168-153-132
  143. let s:gb.medium = ['928374', 244] " 146-131-116
  144. let s:gb.light0 = ['282828', 235] " 40-40-40
  145. let s:gb.light1 = ['3c3836', 237] " 60-56-54
  146. let s:gb.light2 = ['504945', 239] " 80-73-69
  147. let s:gb.light3 = ['665c54', 241] " 102-92-84
  148. let s:gb.light4 = ['7c6f64', 243] " 124-111-100
  149. let s:gb.light4_256 = ['7c6f64', 243] " 124-111-100
  150. let s:gb.red = ['9d0006', 88] " 157-0-6
  151. let s:gb.green = ['79740e', 100] " 121-116-14
  152. let s:gb.yellow = ['b57614', 136] " 181-118-20
  153. let s:gb.blue = ['076678', 24] " 7-102-120
  154. let s:gb.purple = ['8f3f71', 96] " 143-63-113
  155. let s:gb.aqua = ['427b58', 66] " 66-123-88
  156. let s:gb.orange = ['af3a03', 130] " 175-58-3
  157. if g:gruvbox_termcolors == 16
  158. let s:gb.dark0 = ['fbf1c7', 0]
  159. let s:gb.light4 = ['7c6f64', 7]
  160. let s:gb.medium = ['928374', 8]
  161. let s:gb.red = ['9d0006', 9]
  162. let s:gb.green = ['79740e', 10]
  163. let s:gb.yellow = ['b57614', 11]
  164. let s:gb.blue = ['076678', 12]
  165. let s:gb.purple = ['8f3f71', 13]
  166. let s:gb.aqua = ['427b58', 14]
  167. let s:gb.light1 = ['3c3836', 15]
  168. endif
  169. if g:gruvbox_contrast == 'soft'
  170. let s:gb.dark0 = ['f2e5bc', 228] " 242-229-188
  171. endif
  172. if g:gruvbox_contrast == 'hard'
  173. let s:gb.dark0 = ['f9f5d7', 230] " 249-245-215
  174. endif
  175. if g:gruvbox_contrast_light == 'soft'
  176. let s:gb.dark0 = ['f2e5bc', 228] " 242-229-188
  177. endif
  178. if g:gruvbox_contrast_light == 'hard'
  179. let s:gb.dark0 = ['f9f5d7', 230] " 249-245-215
  180. endif
  181. endif
  182. " }}}
  183. " Highlighting Function: {{{
  184. function! s:HL(group, fg, ...)
  185. " Arguments: group, guifg, guibg, gui, guisp
  186. let histring = 'hi ' . a:group . ' '
  187. " if (Foreground override enabled) && ( We were passed a guisp value )
  188. if g:gruvbox_guisp_fallback == 'fg' && a:0 >= 3 && strlen(a:3) && a:3 != 'none'
  189. let c = get(s:gb, a:3)
  190. let histring .= 'guifg=#' . c[0] . ' ctermfg=' . c[1] . ' '
  191. elseif strlen(a:fg)
  192. if a:fg == 'fg'
  193. let histring .= 'guifg=fg ctermfg=fg '
  194. elseif a:fg == 'bg'
  195. let histring .= 'guifg=bg ctermfg=bg '
  196. elseif a:fg == 'none'
  197. let histring .= 'guifg=NONE ctermfg=NONE '
  198. else
  199. let c = get(s:gb, a:fg)
  200. let histring .= 'guifg=#' . c[0] . ' ctermfg=' . c[1] . ' '
  201. endif
  202. endif
  203. " if (Background override enabled) && ( We were passed a guisp value )
  204. if g:gruvbox_guisp_fallback == 'bg' && a:0 >= 3 && strlen(a:3) && a:3 != 'none'
  205. let c = get(s:gb, a:3)
  206. let histring .= 'guibg=#' . c[0] . ' ctermbg=' . c[1] . ' '
  207. elseif a:0 >= 1 && strlen(a:1)
  208. if a:1 == 'bg'
  209. let histring .= 'guibg=bg ctermbg=bg '
  210. elseif a:fg == 'fg'
  211. let histring .= 'guibg=fg ctermbg=fg '
  212. elseif a:1 == 'none'
  213. let histring .= 'guibg=NONE ctermbg=NONE '
  214. else
  215. let c = get(s:gb, a:1)
  216. let histring .= 'guibg=#' . c[0] . ' ctermbg=' . c[1] . ' '
  217. endif
  218. else
  219. let histring .= 'guibg=NONE ctermbg=NONE '
  220. endif
  221. " Hotfixing #24;
  222. " TODO: get rid of this spaghetti
  223. if a:0 >= 2 && strlen(a:2)
  224. if a:2 == 'none'
  225. let histring .= 'gui=NONE cterm=NONE '
  226. elseif a:2 == 'italic' && g:gruvbox_italic == 0
  227. let histring .= 'gui=NONE cterm=NONE '
  228. elseif a:2 == 'bold' && g:gruvbox_bold == 0
  229. let histring .= 'gui=NONE cterm=NONE '
  230. elseif a:2 == 'bold,inverse' && g:gruvbox_bold == 0
  231. let histring .= 'gui=inverse cterm=inverse '
  232. elseif a:2 == 'undercurl' && g:gruvbox_undercurl == 0
  233. let histring .= 'gui=NONE cterm=NONE '
  234. elseif a:2 == 'underline' && g:gruvbox_underline == 0
  235. let histring .= 'gui=NONE cterm=NONE '
  236. elseif a:2 == 'bold,italic'
  237. if g:gruvbox_italic == 0 && g:gruvbox_bold == 0
  238. let histring .= 'gui=NONE cterm=NONE '
  239. elseif g:gruvbox_italic == 0
  240. let histring .= 'gui=bold cterm=bold '
  241. elseif g:gruvbox_bold == 0
  242. let histring .= 'gui=italic cterm=italic '
  243. else
  244. let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' '
  245. endif
  246. elseif a:2 == 'bold,underline'
  247. if g:gruvbox_underline == 0 && g:gruvbox_bold == 0
  248. let histring .= 'gui=NONE cterm=NONE '
  249. elseif g:gruvbox_underline == 0
  250. let histring .= 'gui=bold cterm=bold '
  251. elseif g:gruvbox_bold == 0
  252. let histring .= 'gui=underline cterm=underline '
  253. else
  254. let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' '
  255. endif
  256. elseif a:2 == 'underline,italic'
  257. if g:gruvbox_underline == 0 && g:gruvbox_italic == 0
  258. let histring .= 'gui=NONE cterm=NONE '
  259. elseif g:gruvbox_underline == 0
  260. let histring .= 'gui=italic cterm=italic '
  261. elseif g:gruvbox_italic == 0
  262. let histring .= 'gui=underline cterm=underline '
  263. else
  264. let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' '
  265. endif
  266. elseif a:2 == 'bold,underline,italic'
  267. if g:gruvbox_italic == 0 && g:gruvbox_bold == 0
  268. let histring .= 'gui=underline cterm=underline '
  269. elseif g:gruvbox_italic == 0
  270. let histring .= 'gui=bold,underline cterm=bold,underline '
  271. elseif g:gruvbox_bold == 0
  272. let histring .= 'gui=italic,underline cterm=italic,underline '
  273. else
  274. let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' '
  275. endif
  276. else
  277. let histring .= 'gui=' . a:2 . ' cterm=' . a:2 . ' '
  278. endif
  279. else
  280. let histring .= 'gui=NONE cterm=NONE '
  281. endif
  282. if a:0 >= 3 && strlen(a:3)
  283. if a:3 == 'none'
  284. let histring .= 'guisp=NONE '
  285. else
  286. let c = get(s:gb, a:3)
  287. let histring .= 'guisp=#' . c[0] . ' '
  288. endif
  289. endif
  290. execute histring
  291. endfunction
  292. " }}}
  293. " Vanilla colorscheme ---------------------------------------------------------
  294. " General UI: {{{
  295. " Normal text
  296. call s:HL('Normal', 'light1', 'dark0')
  297. " Correct background (see issue #7):
  298. " --- Problem with changing between dark and light on 256 color terminal
  299. " --- https://github.com/morhetz/gruvbox/issues/7
  300. if s:is_dark
  301. set background=dark
  302. else
  303. set background=light
  304. endif
  305. if version >= 700
  306. " Screen line that the cursor is
  307. call s:HL('CursorLine', 'none', 'dark1')
  308. " Screen column that the cursor is
  309. call s:HL('CursorColumn', 'none', 'dark1')
  310. if g:gruvbox_invert_tabline == 0
  311. " Tab pages line filler
  312. call s:HL('TabLineFill', 'dark4', 'bg')
  313. " Active tab page label
  314. call s:HL('TabLineSel', 'bg', 'dark4', 'bold')
  315. " Not active tab page label
  316. call s:HL('TabLine', 'dark4', 'bg')
  317. else
  318. call s:HL('TabLineFill', 'bg', 'dark4')
  319. call s:HL('TabLineSel', 'dark4', 'bg', 'bold')
  320. call s:HL('TabLine', 'bg', 'dark4')
  321. endif
  322. " Match paired bracket under the cursor
  323. call s:HL('MatchParen', 'none', 'dark3', 'bold')
  324. endif
  325. if version >= 703
  326. " Highlighted screen columns
  327. call s:HL('ColorColumn', 'none', g:gruvbox_color_column)
  328. " Concealed element: \lambda → λ
  329. call s:HL('Conceal', 'blue', 'none')
  330. " Line number of CursorLine
  331. call s:HL('CursorLineNr', 'yellow', 'dark1')
  332. endif
  333. call s:HL('NonText', 'dark2')
  334. call s:HL('SpecialKey', 'dark2')
  335. if g:gruvbox_invert_selection == 0
  336. call s:HL('Visual', 'none', 'dark2')
  337. call s:HL('VisualNOS', 'none', 'dark2')
  338. else
  339. call s:HL('Visual', 'none', 'dark3', 'inverse')
  340. call s:HL('VisualNOS', 'none', 'dark3', 'inverse')
  341. endif
  342. call s:HL('Search', 'dark0', 'yellow')
  343. call s:HL('IncSearch', 'dark0', g:gruvbox_hls_cursor)
  344. call s:HL('Underlined', 'blue', 'none', 'underline')
  345. call s:HL('StatusLine', 'dark4', 'dark0', 'bold,inverse')
  346. call s:HL('StatusLineNC', 'dark2', 'light4', 'bold,inverse')
  347. " The column separating vertically split windows
  348. call s:HL('VertSplit', 'light4', g:gruvbox_vert_split)
  349. " Current match in wildmenu completion
  350. call s:HL('WildMenu', 'blue', 'dark2', 'bold')
  351. " Directory names, special names in listing
  352. call s:HL('Directory', 'green', 'none', 'bold')
  353. " Titles for output from :set all, :autocmd, etc.
  354. call s:HL('Title', 'green', 'none', 'bold')
  355. " Error messages on the command line
  356. call s:HL('ErrorMsg', 'bg', 'red', 'bold')
  357. " More prompt: -- More --
  358. call s:HL('MoreMsg', 'yellow', 'none', 'bold')
  359. " Current mode message: -- INSERT --
  360. call s:HL('ModeMsg', 'yellow', 'none', 'bold')
  361. " 'Press enter' prompt and yes/no questions
  362. call s:HL('Question', 'orange', 'none', 'bold')
  363. " Warning messages
  364. call s:HL('WarningMsg', 'red', 'none', 'bold')
  365. " }}}
  366. " Gutter: {{{
  367. " Line number for :number and :# commands
  368. call s:HL('LineNr', 'dark4')
  369. " Column where signs are displayed
  370. call s:HL('SignColumn', 'none', g:gruvbox_sign_column)
  371. " Line used for closed folds
  372. call s:HL('Folded', 'medium', 'dark1', 'italic')
  373. " Column where folds are displayed
  374. call s:HL('FoldColumn', 'medium', 'dark1')
  375. " }}}
  376. " Cursor: {{{
  377. " Character under cursor
  378. call s:HL('Cursor', 'none', 'none', 'inverse')
  379. " Visual mode cursor, selection
  380. call s:HL('vCursor', 'none', 'none', 'inverse')
  381. " Input moder cursor
  382. call s:HL('iCursor', 'none', 'none', 'inverse')
  383. " Language mapping cursor
  384. call s:HL('lCursor', 'none', 'none', 'inverse')
  385. " }}}
  386. " Syntax Highlighting: {{{
  387. if g:gruvbox_improved_strings == 0
  388. call s:HL('Special', 'orange')
  389. else
  390. call s:HL('Special', 'dark1', 'orange', 'italic')
  391. endif
  392. if g:gruvbox_italicize_comments == 0
  393. call s:HL('Comment', 'medium', 'none')
  394. else
  395. call s:HL('Comment', 'medium', 'none', 'italic')
  396. endif
  397. call s:HL('Todo', 'fg', 'bg', 'bold')
  398. call s:HL('Error', 'bg', 'red', 'bold')
  399. " Generic statement
  400. call s:HL('Statement', 'red')
  401. " if, then, else, endif, swicth, etc.
  402. call s:HL('Conditional', 'red')
  403. " for, do, while, etc.
  404. call s:HL('Repeat', 'red')
  405. " case, default, etc.
  406. call s:HL('Label', 'red')
  407. " try, catch, throw
  408. call s:HL('Exception', 'red')
  409. " sizeof, "+", "*", etc.
  410. hi! link Operator Normal
  411. " Any other keyword
  412. call s:HL('Keyword', 'red')
  413. " Variable name
  414. call s:HL('Identifier', 'blue')
  415. " Function name
  416. call s:HL('Function', 'green', 'none', 'bold')
  417. " Generic preprocessor
  418. call s:HL('PreProc', 'aqua')
  419. " Preprocessor #include
  420. call s:HL('Include', 'aqua')
  421. " Preprocessor #define
  422. call s:HL('Define', 'aqua')
  423. " Same as Define
  424. call s:HL('Macro', 'aqua')
  425. " Preprocessor #if, #else, #endif, etc.
  426. call s:HL('PreCondit', 'aqua')
  427. " Generic constant
  428. call s:HL('Constant', 'purple')
  429. " Character constant: 'c', '/n'
  430. call s:HL('Character', 'purple')
  431. " String constant: "this is a string"
  432. if g:gruvbox_italicize_strings == 0
  433. call s:HL('String', 'green')
  434. else
  435. if g:gruvbox_improved_strings == 0
  436. call s:HL('String', 'green', 'none', 'italic')
  437. else
  438. call s:HL('String', 'dark1', 'light1', 'italic')
  439. endif
  440. endif
  441. " Boolean constant: TRUE, false
  442. call s:HL('Boolean', 'purple')
  443. " Number constant: 234, 0xff
  444. call s:HL('Number', 'purple')
  445. " Floating point constant: 2.3e10
  446. call s:HL('Float', 'purple')
  447. " Generic type
  448. call s:HL('Type', 'yellow')
  449. " static, register, volatile, etc
  450. call s:HL('StorageClass', 'orange')
  451. " struct, union, enum, etc.
  452. call s:HL('Structure', 'aqua')
  453. " typedef
  454. call s:HL('Typedef', 'yellow')
  455. " }}}
  456. " Completion Menu: {{{
  457. if version >= 700
  458. " Popup menu: normal item
  459. call s:HL('Pmenu', 'light1', 'dark2')
  460. " Popup menu: selected item
  461. call s:HL('PmenuSel', 'dark2', 'blue', 'bold')
  462. " Popup menu: scrollbar
  463. call s:HL('PmenuSbar', 'none', 'dark2')
  464. " Popup menu: scrollbar thumb
  465. call s:HL('PmenuThumb', 'none', 'dark4')
  466. endif
  467. " }}}
  468. " Diffs: {{{
  469. call s:HL('DiffDelete', 'dark0', 'red')
  470. call s:HL('DiffAdd', 'dark0', 'green')
  471. "call s:HL('DiffChange', 'dark0', 'blue')
  472. "call s:HL('DiffText', 'dark0', 'yellow')
  473. " Alternative setting
  474. call s:HL('DiffChange', 'dark0', 'aqua')
  475. call s:HL('DiffText', 'dark0', 'yellow')
  476. " }}}
  477. " Spelling: {{{
  478. if has("spell")
  479. " Not capitalised word, or compile warnings
  480. if g:gruvbox_improved_warnings == 0
  481. call s:HL('SpellCap', 'none', 'none', 'undercurl', 'red')
  482. else
  483. call s:HL('SpellCap', 'green', 'none', 'italic,bold')
  484. endif
  485. " Not recognized word
  486. call s:HL('SpellBad', 'none', 'none', 'undercurl', 'blue')
  487. " Wrong spelling for selected region
  488. call s:HL('SpellLocal', 'none', 'none', 'undercurl', 'aqua')
  489. " Rare word
  490. call s:HL('SpellRare', 'none', 'none', 'undercurl', 'purple')
  491. endif
  492. " }}}
  493. " Plugin specific -------------------------------------------------------------
  494. " EasyMotion: {{{
  495. hi! link EasyMotionTarget Search
  496. hi! link EasyMotionShade Comment
  497. " }}}
  498. " Sneak: {{{
  499. hi! link SneakPluginTarget Search
  500. hi! link SneakStreakTarget Search
  501. call s:HL('SneakStreakMask', 'yellow', 'yellow')
  502. hi! link SneakStreakStatusLine Search
  503. " }}}
  504. " Indent Guides: {{{
  505. if !exists('g:indent_guides_auto_colors')
  506. let g:indent_guides_auto_colors = 0
  507. endif
  508. if g:indent_guides_auto_colors == 0
  509. if g:gruvbox_invert_indent_guides == 0
  510. call s:HL('IndentGuidesOdd', 'bg', 'dark2')
  511. call s:HL('IndentGuidesEven', 'bg', 'dark1')
  512. else
  513. call s:HL('IndentGuidesOdd', 'bg', 'dark2', 'inverse')
  514. call s:HL('IndentGuidesEven', 'bg', 'dark3', 'inverse')
  515. endif
  516. endif
  517. " }}}
  518. " IndentLine: {{{
  519. if !exists('g:indentLine_color_term')
  520. let g:indentLine_color_term = s:gb.dark2[1]
  521. endif
  522. if !exists('g:indentLine_color_gui')
  523. let g:indentLine_color_gui = '#' . s:gb.dark2[0]
  524. endif
  525. " }}}
  526. " Rainbow Parentheses: {{{
  527. if !exists('g:rbpt_colorpairs')
  528. let g:rbpt_colorpairs =
  529. \ [
  530. \ ['blue', '#458588'], ['magenta', '#b16286'],
  531. \ ['red', '#cc241d'], ['166', '#d65d0e']
  532. \ ]
  533. endif
  534. let g:rainbow_guifgs = [ '#d65d0e', '#cc241d', '#b16286', '#458588' ]
  535. let g:rainbow_ctermfgs = [ '166', 'red', 'magenta', 'blue' ]
  536. if !exists('g:rainbow_conf')
  537. let g:rainbow_conf = {}
  538. endif
  539. if !has_key(g:rainbow_conf, 'guifgs')
  540. let g:rainbow_conf['guifgs'] = g:rainbow_guifgs
  541. endif
  542. if !has_key(g:rainbow_conf, 'ctermfgs')
  543. let g:rainbow_conf['ctermfgs'] = g:rainbow_ctermfgs
  544. endif
  545. let g:niji_dark_colours = g:rbpt_colorpairs
  546. let g:niji_light_colours = g:rbpt_colorpairs
  547. "}}}
  548. " GitGutter: {{{
  549. if g:gruvbox_invert_signs == 0
  550. call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column)
  551. call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column)
  552. call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column)
  553. call s:HL('GitGutterChangeDelete', 'aqua', g:gruvbox_sign_column)
  554. else
  555. call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column, 'inverse')
  556. call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column, 'inverse')
  557. call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column, 'inverse')
  558. call s:HL('GitGutterChangeDelete', 'aqua', g:gruvbox_sign_column, 'inverse')
  559. endif
  560. " }}}
  561. " gitcommit highlighting "{{{
  562. call s:HL('gitcommitSelectedFile', 'green')
  563. call s:HL('gitcommitDiscardedFile', 'red')
  564. " }}}
  565. " Signify: {{{
  566. if g:gruvbox_invert_signs == 0
  567. call s:HL('SignifySignAdd', 'green', g:gruvbox_sign_column)
  568. call s:HL('SignifySignChange ', 'aqua', g:gruvbox_sign_column)
  569. call s:HL('SignifySignDelete', 'red', g:gruvbox_sign_column)
  570. else
  571. call s:HL('SignifySignAdd', 'green', g:gruvbox_sign_column, 'inverse')
  572. call s:HL('SignifySignChange ', 'aqua', g:gruvbox_sign_column, 'inverse')
  573. call s:HL('SignifySignDelete', 'red', g:gruvbox_sign_column, 'inverse')
  574. endif
  575. " }}}
  576. " Syntastic: {{{
  577. call s:HL('SyntasticError', 'none', 'none', 'undercurl', 'red')
  578. call s:HL('SyntasticWarning', 'none', 'none', 'undercurl', 'yellow')
  579. if g:gruvbox_invert_signs == 0
  580. call s:HL('SyntasticErrorSign', 'red', g:gruvbox_sign_column)
  581. call s:HL('SyntasticWarningSign', 'yellow', g:gruvbox_sign_column)
  582. else
  583. call s:HL('SyntasticErrorSign', 'red', g:gruvbox_sign_column, 'inverse')
  584. call s:HL('SyntasticWarningSign', 'yellow', g:gruvbox_sign_column, 'inverse')
  585. endif
  586. " }}}
  587. " Signature: {{{
  588. if g:gruvbox_invert_signs == 0
  589. call s:HL('SignatureMarkerText', 'purple', g:gruvbox_sign_column)
  590. call s:HL('SignatureMarkText', 'blue', g:gruvbox_sign_column)
  591. else
  592. call s:HL('SignatureMarkerText', 'purple', g:gruvbox_sign_column, 'inverse')
  593. call s:HL('SignatureMarkText', 'blue', g:gruvbox_sign_column, 'inverse')
  594. endif
  595. let g:SignatureMarkerTextHL='"SignatureMarkerText"'
  596. let g:SignatureMarkTextHL='"SignatureMarkText"'
  597. " }}}
  598. " ShowMarks: {{{
  599. if g:gruvbox_invert_signs == 0
  600. call s:HL('ShowMarksHLl', 'blue', g:gruvbox_sign_column)
  601. call s:HL('ShowMarksHLu', 'blue', g:gruvbox_sign_column)
  602. call s:HL('ShowMarksHLo', 'blue', g:gruvbox_sign_column)
  603. call s:HL('ShowMarksHLm', 'blue', g:gruvbox_sign_column)
  604. else
  605. call s:HL('ShowMarksHLl', 'blue', g:gruvbox_sign_column, 'inverse')
  606. call s:HL('ShowMarksHLu', 'blue', g:gruvbox_sign_column, 'inverse')
  607. call s:HL('ShowMarksHLo', 'blue', g:gruvbox_sign_column, 'inverse')
  608. call s:HL('ShowMarksHLm', 'blue', g:gruvbox_sign_column, 'inverse')
  609. endif
  610. " }}}
  611. " CtrlP: {{{
  612. call s:HL('CtrlPMatch', 'yellow')
  613. call s:HL('CtrlPNoEntries', 'red')
  614. call s:HL('CtrlPPrtBase', 'dark2')
  615. call s:HL('CtrlPPrtCursor', 'blue')
  616. call s:HL('CtrlPLinePre', 'dark2')
  617. call s:HL('CtrlPMode1', 'blue', 'dark2', 'bold')
  618. call s:HL('CtrlPMode2', 'dark0', 'blue', 'bold')
  619. call s:HL('CtrlPStats', 'light4', 'dark2', 'bold')
  620. " }}}
  621. " Startify: {{{
  622. call s:HL('StartifyBracket', 'light3')
  623. call s:HL('StartifyFile', 'light0')
  624. call s:HL('StartifyNumber', 'blue')
  625. call s:HL('StartifyPath', 'medium')
  626. call s:HL('StartifySlash', 'medium')
  627. call s:HL('StartifySection', 'yellow')
  628. call s:HL('StartifySpecial', 'dark2')
  629. call s:HL('StartifyHeader', 'orange')
  630. call s:HL('StartifyFooter', 'dark2')
  631. " }}}
  632. " Vimshell: {{{
  633. let g:vimshell_escape_colors = map(split(
  634. \ 'dark4 red green yellow blue purple aqua light4 ' .
  635. \ 'dark0 red green orange blue purple aqua light0'
  636. \ ), '"#" . s:gb[v:val][0]')
  637. " }}}
  638. " Filetype specific -----------------------------------------------------------
  639. " Diff: {{{
  640. call s:HL('diffAdded', 'green')
  641. call s:HL('diffRemoved', 'red')
  642. call s:HL('diffChanged', 'aqua')
  643. call s:HL('diffFile', 'orange')
  644. call s:HL('diffNewFile', 'yellow')
  645. call s:HL('diffLine', 'blue')
  646. " }}}
  647. " Html: {{{
  648. call s:HL('htmlTag', 'blue')
  649. call s:HL('htmlEndTag', 'blue')
  650. call s:HL('htmlTagName', 'aqua', 'none', 'bold')
  651. call s:HL('htmlArg', 'aqua')
  652. call s:HL('htmlScriptTag', 'purple')
  653. call s:HL('htmlTagN', 'light1')
  654. call s:HL('htmlSpecialTagName', 'aqua', 'none', 'bold')
  655. call s:HL('htmlLink', 'light4', 'none', 'underline')
  656. call s:HL('htmlSpecialChar', 'orange')
  657. call s:HL('htmlBold', 'fg', 'bg', 'bold')
  658. call s:HL('htmlBoldUnderline', 'fg', 'bg', 'bold,underline')
  659. call s:HL('htmlBoldItalic', 'fg', 'bg', 'bold,italic')
  660. call s:HL('htmlBoldUnderlineItalic', 'fg', 'bg', 'bold,underline,italic')
  661. call s:HL('htmlUnderline', 'fg', 'bg', 'underline')
  662. call s:HL('htmlUnderlineItalic', 'fg', 'bg', 'underline,italic')
  663. call s:HL('htmlItalic', 'fg', 'bg', 'italic')
  664. " }}}
  665. " Xml: {{{
  666. call s:HL('xmlTag', 'blue')
  667. call s:HL('xmlEndTag', 'blue')
  668. call s:HL('xmlTagName', 'blue')
  669. call s:HL('xmlEqual', 'blue')
  670. call s:HL('docbkKeyword', 'aqua', 'none', 'bold')
  671. call s:HL('xmlDocTypeDecl', 'medium')
  672. call s:HL('xmlDocTypeKeyword', 'purple')
  673. call s:HL('xmlCdataStart', 'medium')
  674. call s:HL('xmlCdataCdata', 'purple')
  675. call s:HL('dtdFunction', 'medium')
  676. call s:HL('dtdTagName', 'purple')
  677. call s:HL('xmlAttrib', 'aqua')
  678. call s:HL('xmlProcessingDelim', 'medium')
  679. call s:HL('dtdParamEntityPunct', 'medium')
  680. call s:HL('dtdParamEntityDPunct', 'medium')
  681. call s:HL('xmlAttribPunct', 'medium')
  682. call s:HL('xmlEntity', 'orange')
  683. call s:HL('xmlEntityPunct', 'orange')
  684. " }}}
  685. " Vim: {{{
  686. if g:gruvbox_italicize_comments == 0
  687. call s:HL('vimCommentTitle', 'light4_256', 'none', 'bold')
  688. else
  689. call s:HL('vimCommentTitle', 'light4_256', 'none', 'bold,italic')
  690. endif
  691. call s:HL('vimNotation', 'orange')
  692. call s:HL('vimBracket', 'orange')
  693. call s:HL('vimMapModKey', 'orange')
  694. call s:HL('vimFuncSID', 'light3')
  695. call s:HL('vimSetSep', 'light3')
  696. call s:HL('vimSep', 'light3')
  697. call s:HL('vimContinue', 'light3')
  698. " }}}
  699. " Clojure: {{{
  700. call s:HL('clojureKeyword', 'blue')
  701. call s:HL('clojureCond', 'orange')
  702. call s:HL('clojureSpecial', 'orange')
  703. call s:HL('clojureDefine', 'orange')
  704. call s:HL('clojureFunc', 'yellow')
  705. call s:HL('clojureRepeat', 'yellow')
  706. call s:HL('clojureCharacter', 'aqua')
  707. call s:HL('clojureStringEscape', 'aqua')
  708. call s:HL('clojureException', 'red')
  709. call s:HL('clojureRegexp', 'aqua')
  710. call s:HL('clojureRegexpEscape', 'aqua')
  711. call s:HL('clojureRegexpCharClass', 'light3', 'none', 'bold')
  712. call s:HL('clojureRegexpMod', 'light3', 'none', 'bold')
  713. call s:HL('clojureRegexpQuantifier', 'light3', 'none', 'bold')
  714. call s:HL('clojureParen', 'light3')
  715. call s:HL('clojureAnonArg', 'yellow')
  716. call s:HL('clojureVariable', 'blue')
  717. call s:HL('clojureMacro', 'orange')
  718. call s:HL('clojureMeta', 'yellow')
  719. call s:HL('clojureDeref', 'yellow')
  720. call s:HL('clojureQuote', 'yellow')
  721. call s:HL('clojureUnquote', 'yellow')
  722. " }}}
  723. " C: {{{
  724. call s:HL('cOperator', 'purple')
  725. call s:HL('cStructure', 'orange')
  726. " }}}
  727. " Python: {{{
  728. call s:HL('pythonBuiltin', 'orange')
  729. call s:HL('pythonBuiltinObj', 'orange')
  730. call s:HL('pythonBuiltinFunc', 'orange')
  731. call s:HL('pythonFunction', 'aqua')
  732. call s:HL('pythonDecorator', 'red')
  733. call s:HL('pythonInclude', 'blue')
  734. call s:HL('pythonImport', 'blue')
  735. call s:HL('pythonRun', 'blue')
  736. call s:HL('pythonCoding', 'blue')
  737. call s:HL('pythonOperator', 'red')
  738. call s:HL('pythonExceptions', 'purple')
  739. call s:HL('pythonBoolean', 'purple')
  740. call s:HL('pythonDot', 'light3')
  741. " }}}
  742. " CSS: {{{
  743. call s:HL('cssBraces', 'blue')
  744. call s:HL('cssFunctionName', 'yellow')
  745. call s:HL('cssIdentifier', 'orange')
  746. call s:HL('cssClassName', 'green')
  747. call s:HL('cssColor', 'blue')
  748. call s:HL('cssSelectorOp', 'blue')
  749. call s:HL('cssSelectorOp2', 'blue')
  750. call s:HL('cssImportant', 'green')
  751. call s:HL('cssVendor', 'light1')
  752. call s:HL('cssTextProp', 'aqua')
  753. call s:HL('cssAnimationProp', 'aqua')
  754. call s:HL('cssUIProp', 'yellow')
  755. call s:HL('cssTransformProp', 'aqua')
  756. call s:HL('cssTransitionProp', 'aqua')
  757. call s:HL('cssPrintProp', 'aqua')
  758. call s:HL('cssPositioningProp', 'yellow')
  759. call s:HL('cssBoxProp', 'aqua')
  760. call s:HL('cssFontDescriptorProp', 'aqua')
  761. call s:HL('cssFlexibleBoxProp', 'aqua')
  762. call s:HL('cssBorderOutlineProp', 'aqua')
  763. call s:HL('cssBackgroundProp', 'aqua')
  764. call s:HL('cssMarginProp', 'aqua')
  765. call s:HL('cssListProp', 'aqua')
  766. call s:HL('cssTableProp', 'aqua')
  767. call s:HL('cssFontProp', 'aqua')
  768. call s:HL('cssPaddingProp', 'aqua')
  769. call s:HL('cssDimensionProp', 'aqua')
  770. call s:HL('cssRenderProp', 'aqua')
  771. call s:HL('cssColorProp', 'aqua')
  772. call s:HL('cssGeneratedContentProp', 'aqua')
  773. " }}}
  774. " JavaScript: {{{
  775. call s:HL('javaScriptBraces', 'orange')
  776. call s:HL('javaScriptFunction', 'aqua')
  777. call s:HL('javaScriptIdentifier', 'red')
  778. call s:HL('javaScriptMember', 'blue')
  779. call s:HL('javaScriptNumber', 'purple')
  780. call s:HL('javaScriptNull', 'purple')
  781. call s:HL('javaScriptParens', 'light3')
  782. " }}}
  783. " CoffeeScript: {{{
  784. call s:HL('coffeeExtendedOp', 'light3')
  785. call s:HL('coffeeSpecialOp', 'light3')
  786. call s:HL('coffeeCurly', 'orange')
  787. call s:HL('coffeeParen', 'light3')
  788. call s:HL('coffeeBracket', 'orange')
  789. " }}}
  790. " Ruby: {{{
  791. call s:HL('rubyStringDelimiter', 'green')
  792. call s:HL('rubyInterpolationDelimiter', 'aqua')
  793. " }}}
  794. " ObjectiveC: {{{
  795. call s:HL('objcTypeModifier', 'red')
  796. call s:HL('objcDirective', 'blue')
  797. " }}}
  798. " Go: {{{
  799. call s:HL('goDirective', 'aqua')
  800. call s:HL('goConstants', 'purple')
  801. call s:HL('goDeclaration', 'red')
  802. call s:HL('goDeclType', 'blue')
  803. call s:HL('goBuiltins', 'orange')
  804. " }}}
  805. " Lua: {{{
  806. call s:HL('luaIn', 'red')
  807. call s:HL('luaFunction', 'aqua')
  808. call s:HL('luaTable', 'orange')
  809. " }}}
  810. " MoonScript: {{{
  811. call s:HL('moonSpecialOp', 'light3')
  812. call s:HL('moonExtendedOp', 'light3')
  813. call s:HL('moonFunction', 'light3')
  814. call s:HL('moonObject', 'yellow')
  815. " }}}
  816. " Java: {{{
  817. call s:HL('javaAnnotation', 'blue')
  818. call s:HL('javaDocTags', 'aqua')
  819. hi! link javaCommentTitle vimCommentTitle
  820. call s:HL('javaParen', 'light3')
  821. call s:HL('javaParen1', 'light3')
  822. call s:HL('javaParen2', 'light3')
  823. call s:HL('javaParen3', 'light3')
  824. call s:HL('javaParen4', 'light3')
  825. call s:HL('javaParen5', 'light3')
  826. call s:HL('javaOperator', 'orange')
  827. call s:HL('javaVarArg', 'green')
  828. " }}}
  829. " Elixir: {{{
  830. hi! link elixirDocString Comment
  831. call s:HL('elixirStringDelimiter', 'green')
  832. call s:HL('elixirInterpolationDelimiter', 'aqua')
  833. " }}}
  834. " Scala: {{{
  835. " NB: scala vim syntax file is kinda horrible
  836. call s:HL('scalaNameDefinition', 'light1')
  837. call s:HL('scalaCaseFollowing', 'light1')
  838. call s:HL('scalaCapitalWord', 'light1')
  839. call s:HL('scalaTypeExtension', 'light1')
  840. call s:HL('scalaKeyword', 'red')
  841. call s:HL('scalaKeywordModifier', 'red')
  842. call s:HL('scalaSpecial', 'aqua')
  843. call s:HL('scalaOperator', 'light1')
  844. call s:HL('scalaTypeDeclaration', 'yellow')
  845. call s:HL('scalaTypeTypePostDeclaration', 'yellow')
  846. call s:HL('scalaInstanceDeclaration', 'light1')
  847. call s:HL('scalaInterpolation', 'aqua')
  848. " }}}
  849. " Markdown: {{{
  850. call s:HL('markdownItalic', 'light3', 'none', 'italic')
  851. call s:HL('markdownH1', 'green', 'none', 'bold')
  852. call s:HL('markdownH2', 'green', 'none', 'bold')
  853. call s:HL('markdownH3', 'yellow', 'none', 'bold')
  854. call s:HL('markdownH4', 'yellow', 'none', 'bold')
  855. call s:HL('markdownH5', 'yellow')
  856. call s:HL('markdownH6', 'yellow')
  857. call s:HL('markdownCode', 'aqua')
  858. call s:HL('markdownCodeBlock', 'aqua')
  859. call s:HL('markdownCodeDelimiter', 'aqua')
  860. call s:HL('markdownBlockquote', 'medium')
  861. call s:HL('markdownListMarker', 'medium')
  862. call s:HL('markdownOrderedListMarker', 'medium')
  863. call s:HL('markdownRule', 'medium')
  864. call s:HL('markdownHeadingRule', 'medium')
  865. call s:HL('markdownUrlDelimiter', 'light3')
  866. call s:HL('markdownLinkDelimiter', 'light3')
  867. call s:HL('markdownLinkTextDelimiter', 'light3')
  868. call s:HL('markdownHeadingDelimiter', 'orange')
  869. call s:HL('markdownUrl', 'purple')
  870. call s:HL('markdownUrlTitleDelimiter', 'green')
  871. call s:HL('markdownLinkText', 'medium', 'none', 'underline')
  872. call s:HL('markdownIdDeclaration', 'medium', 'none', 'underline')
  873. " }}}
  874. " Functions -------------------------------------------------------------------
  875. " Search Highlighting Cursor {{{
  876. function! GruvboxHlsShowCursor()
  877. call s:HL('Cursor', 'dark0', g:gruvbox_hls_cursor)
  878. call s:HL('vCursor', 'dark0', g:gruvbox_hls_cursor)
  879. call s:HL('iCursor', 'dark0', g:gruvbox_hls_cursor)
  880. call s:HL('lCursor', 'dark0', g:gruvbox_hls_cursor)
  881. endfunction
  882. function! GruvboxHlsHideCursor()
  883. call s:HL('Cursor', 'none', 'none', 'inverse')
  884. call s:HL('vCursor', 'none', 'none', 'inverse')
  885. call s:HL('iCursor', 'none', 'none', 'inverse')
  886. call s:HL('lCursor', 'none', 'none', 'inverse')
  887. endfunction
  888. " }}}
  889. " vim: set sw=3 ts=3 sts=3 noet tw=80 ft=vim fdm=marker: