gruvbox.vim 27 KB

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