gruvbox.vim 29 KB

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