gruvbox.vim 27 KB

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