solarized.vim 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. " Name: Solarized vim colorscheme
  2. " Author: Ethan Schoonover <es@ethanschoonover.com>
  3. " URL: http://ethanschoonover.com/solarized
  4. " (see this url for latest release & screenshots)
  5. " License: OSI approved MIT license (see end of this file)
  6. " Created: In the middle of the night
  7. " Modified: 2011 May 05
  8. "
  9. " Usage "{{{
  10. "
  11. " ---------------------------------------------------------------------
  12. " ABOUT:
  13. " ---------------------------------------------------------------------
  14. " Solarized is a carefully designed selective contrast colorscheme with dual
  15. " light and dark modes that runs in both GUI, 256 and 16 color modes.
  16. "
  17. " See the homepage above for screenshots and details.
  18. "
  19. " ---------------------------------------------------------------------
  20. " OPTIONS:
  21. " ---------------------------------------------------------------------
  22. " See the "solarized.txt" help file included with this colorscheme (in the
  23. " "doc" subdirectory) for information on options, usage, the Toggle Background
  24. " function and more. If you have already installed Solarized, this is available
  25. " from the Solarized menu and command line as ":help solarized"
  26. "
  27. " ---------------------------------------------------------------------
  28. " INSTALLATION:
  29. " ---------------------------------------------------------------------
  30. " Two options for installation: manual or pathogen
  31. "
  32. " MANUAL INSTALLATION OPTION:
  33. " ---------------------------------------------------------------------
  34. "
  35. " 1. Download the solarized distribution (available on the homepage above)
  36. " and unarchive the file.
  37. " 2. Move `solarized.vim` to your `.vim/colors` directory.
  38. " 3. Move each of the files in each subdirectories to the corresponding .vim
  39. " subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload
  40. " directory as .vim/autoload/togglebg.vim).
  41. "
  42. " RECOMMENDED PATHOGEN INSTALLATION OPTION:
  43. " ---------------------------------------------------------------------
  44. "
  45. " 1. Download and install Tim Pope's Pathogen from:
  46. " https://github.com/tpope/vim-pathogen
  47. "
  48. " 2. Next, move or clone the `vim-colors-solarized` directory so that it is
  49. " a subdirectory of the `.vim/bundle` directory.
  50. "
  51. " a. **clone with git:**
  52. "
  53. " $ cd ~/.vim/bundle
  54. " $ git clone git://github.com/altercation/vim-colors-solarized.git
  55. "
  56. " b. **or move manually into the pathogen bundle directory:**
  57. " In the parent directory of vim-colors-solarized:
  58. "
  59. " $ mv vim-colors-solarized ~/.vim/bundle/
  60. "
  61. " MODIFY VIMRC:
  62. "
  63. " After either Option 1 or Option 2 above, put the following two lines in your
  64. " .vimrc:
  65. "
  66. " syntax enable
  67. " set background=dark
  68. " colorscheme solarized
  69. "
  70. " or, for the light background mode of Solarized:
  71. "
  72. " syntax enable
  73. " set background=light
  74. " colorscheme solarized
  75. "
  76. " I like to have a different background in GUI and terminal modes, so I can use
  77. " the following if-then. However, I find vim's background autodetection to be
  78. " pretty good and, at least with MacVim, I can leave this background value
  79. " assignment out entirely and get the same results.
  80. "
  81. " if has('gui_running')
  82. " set background=light
  83. " else
  84. " set background=dark
  85. " endif
  86. "
  87. " See the Solarized homepage at http://ethanschoonover.com/solarized for
  88. " screenshots which will help you select either the light or dark background.
  89. "
  90. " ---------------------------------------------------------------------
  91. " COLOR VALUES
  92. " ---------------------------------------------------------------------
  93. " Download palettes and files from: http://ethanschoonover.com/solarized
  94. "
  95. " L\*a\*b values are canonical (White D65, Reference D50), other values are
  96. " matched in sRGB space.
  97. "
  98. " SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B sRGB HSB
  99. " --------- ------- ---- ------- ----------- ---------- ----------- -----------
  100. " base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
  101. " base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
  102. " base01 #586e75 10/7 brgreen 240 #4e4e4e 45 -07 -07 88 110 117 194 25 46
  103. " base00 #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195 23 51
  104. " base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
  105. " base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
  106. " base2 #eee8d5 7/7 white 254 #d7d7af 92 -00 10 238 232 213 44 11 93
  107. " base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
  108. " yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71
  109. " orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80
  110. " red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86
  111. " magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83
  112. " violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77
  113. " blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
  114. " cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
  115. " green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60
  116. "
  117. " ---------------------------------------------------------------------
  118. " COLORSCHEME HACKING
  119. " ---------------------------------------------------------------------
  120. "
  121. " Useful commands for testing colorschemes:
  122. " :source $VIMRUNTIME/syntax/hitest.vim
  123. " :help highlight-groups
  124. " :help cterm-colors
  125. " :help group-name
  126. "
  127. " Useful links for developing colorschemes:
  128. " http://www.vim.org/scripts/script.php?script_id=2937
  129. " http://vimcasts.org/episodes/creating-colorschemes-for-vim/
  130. " http://www.frexx.de/xterm-256-notes/"
  131. "
  132. " }}}
  133. " Environment Specific Overrides "{{{
  134. " Allow or disallow certain features based on current terminal emulator or
  135. " environment.
  136. " Terminals that support italics
  137. let s:terms_italic=[
  138. \"rxvt",
  139. \"gnome-terminal"
  140. \]
  141. " For reference only, terminals are known to be incomptible.
  142. " Terminals that are in neither list need to be tested.
  143. let s:terms_noitalic=[
  144. \"iTerm.app",
  145. \"Apple_Terminal"
  146. \]
  147. if has("gui_running")
  148. let s:terminal_italic=1 " TODO: could refactor to not require this at all
  149. else
  150. let s:terminal_italic=0 " terminals will be guilty until proven compatible
  151. for term in s:terms_italic
  152. if $TERM_PROGRAM =~ term
  153. let s:terminal_italic=1
  154. endif
  155. endfor
  156. endif
  157. " }}}
  158. " Default option values"{{{
  159. " ---------------------------------------------------------------------
  160. " s:options_list is used to autogenerate a list of all non-default options
  161. " using "call SolarizedOptions()" or with the "Generate .vimrc commands"
  162. " Solarized menu option. See the "Menus" section below for the function itself.
  163. let s:options_list=[
  164. \'" this block of commands has been autogenerated by solarized.vim and',
  165. \'" includes the current, non-default Solarized option values.',
  166. \'" To use, place these commands in your .vimrc file (replacing any',
  167. \'" existing colorscheme commands). See also ":help solarized"',
  168. \'',
  169. \'" ------------------------------------------------------------------',
  170. \'" Solarized Colorscheme Config',
  171. \'" ------------------------------------------------------------------',
  172. \]
  173. let s:colorscheme_list=[
  174. \'syntax enable',
  175. \'set background='.&background,
  176. \'colorscheme solarized',
  177. \]
  178. let s:defaults_list=[
  179. \'" ------------------------------------------------------------------',
  180. \'',
  181. \'" The following items are available options, but do not need to be',
  182. \'" included in your .vimrc as they are currently set to their defaults.',
  183. \''
  184. \]
  185. let s:lazycat_list=[
  186. \'" lazy method of appending this onto your .vimrc ":w! >> ~/.vimrc"',
  187. \'" ------------------------------------------------------------------',
  188. \]
  189. function! s:SetOption(name,default)
  190. if type(a:default) == type(0)
  191. let l:wrap=''
  192. let l:ewrap=''
  193. else
  194. let l:wrap='"'
  195. let l:ewrap='\"'
  196. endif
  197. if !exists("g:solarized_".a:name) || g:solarized_{a:name}==a:default
  198. exe 'let g:solarized_'.a:name.'='.l:wrap.a:default.l:wrap.'"'
  199. exe 'call add(s:defaults_list, "\" let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.'")'
  200. else
  201. exe 'call add(s:options_list, "let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.' \"default value is '.a:default.'")'
  202. endif
  203. endfunction
  204. if ($TERM_PROGRAM ==? "apple_terminal" && &t_Co < 256)
  205. let s:solarized_termtrans_default = 1
  206. else
  207. let s:solarized_termtrans_default = 0
  208. endif
  209. call s:SetOption("termtrans",s:solarized_termtrans_default)
  210. call s:SetOption("degrade",0)
  211. call s:SetOption("bold",1)
  212. call s:SetOption("underline",1)
  213. call s:SetOption("italic",1) " note that we need to override this later if the terminal doesn't support
  214. call s:SetOption("termcolors",16)
  215. call s:SetOption("contrast","normal")
  216. call s:SetOption("visibility","normal")
  217. call s:SetOption("diffmode","normal")
  218. call s:SetOption("hitrail",0)
  219. call s:SetOption("menu",1)
  220. "}}}
  221. " Colorscheme initialization "{{{
  222. " ---------------------------------------------------------------------
  223. hi clear
  224. if exists("syntax_on")
  225. syntax reset
  226. endif
  227. let colors_name = "solarized"
  228. "}}}
  229. " GUI & CSApprox hexadecimal palettes"{{{
  230. " ---------------------------------------------------------------------
  231. "
  232. " Set both gui and terminal color values in separate conditional statements
  233. " Due to possibility that CSApprox is running (though I suppose we could just
  234. " leave the hex values out entirely in that case and include only cterm colors)
  235. " We also check to see if user has set solarized (force use of the
  236. " neutral gray monotone palette component)
  237. if (has("gui_running") && g:solarized_degrade == 0)
  238. let s:vmode = "gui"
  239. let s:base03 = "#002b36"
  240. let s:base02 = "#073642"
  241. let s:base01 = "#586e75"
  242. let s:base00 = "#657b83"
  243. let s:base0 = "#839496"
  244. let s:base1 = "#93a1a1"
  245. let s:base2 = "#eee8d5"
  246. let s:base3 = "#fdf6e3"
  247. let s:yellow = "#b58900"
  248. let s:orange = "#cb4b16"
  249. let s:red = "#dc322f"
  250. let s:magenta = "#d33682"
  251. let s:violet = "#6c71c4"
  252. let s:blue = "#268bd2"
  253. let s:cyan = "#2aa198"
  254. "let s:green = "#859900" "original
  255. let s:green = "#719e07" "experimental
  256. elseif (has("gui_running") && g:solarized_degrade == 1)
  257. " These colors are identical to the 256 color mode. They may be viewed
  258. " while in gui mode via "let g:solarized_degrade=1", though this is not
  259. " recommened and is for testing only.
  260. let s:vmode = "gui"
  261. let s:base03 = "#1c1c1c"
  262. let s:base02 = "#262626"
  263. let s:base01 = "#4e4e4e"
  264. let s:base00 = "#585858"
  265. let s:base0 = "#808080"
  266. let s:base1 = "#8a8a8a"
  267. let s:base2 = "#d7d7af"
  268. let s:base3 = "#ffffd7"
  269. let s:yellow = "#af8700"
  270. let s:orange = "#d75f00"
  271. let s:red = "#af0000"
  272. let s:magenta = "#af005f"
  273. let s:violet = "#5f5faf"
  274. let s:blue = "#0087ff"
  275. let s:cyan = "#00afaf"
  276. let s:green = "#5f8700"
  277. elseif g:solarized_termcolors != 256 && &t_Co >= 16
  278. let s:vmode = "cterm"
  279. let s:base03 = "8"
  280. let s:base02 = "0"
  281. let s:base01 = "10"
  282. let s:base00 = "11"
  283. let s:base0 = "12"
  284. let s:base1 = "14"
  285. let s:base2 = "7"
  286. let s:base3 = "15"
  287. let s:yellow = "3"
  288. let s:orange = "9"
  289. let s:red = "1"
  290. let s:magenta = "5"
  291. let s:violet = "13"
  292. let s:blue = "4"
  293. let s:cyan = "6"
  294. let s:green = "2"
  295. elseif g:solarized_termcolors == 256
  296. let s:vmode = "cterm"
  297. let s:base03 = "234"
  298. let s:base02 = "235"
  299. let s:base01 = "239"
  300. let s:base00 = "240"
  301. let s:base0 = "244"
  302. let s:base1 = "245"
  303. let s:base2 = "187"
  304. let s:base3 = "230"
  305. let s:yellow = "136"
  306. let s:orange = "166"
  307. let s:red = "124"
  308. let s:magenta = "125"
  309. let s:violet = "61"
  310. let s:blue = "33"
  311. let s:cyan = "37"
  312. let s:green = "64"
  313. else
  314. let s:vmode = "cterm"
  315. let s:bright = "* term=bold cterm=bold"
  316. " let s:base03 = "0".s:bright
  317. " let s:base02 = "0"
  318. " let s:base01 = "2".s:bright
  319. " let s:base00 = "3".s:bright
  320. " let s:base0 = "4".s:bright
  321. " let s:base1 = "6".s:bright
  322. " let s:base2 = "7"
  323. " let s:base3 = "7".s:bright
  324. " let s:yellow = "3"
  325. " let s:orange = "1".s:bright
  326. " let s:red = "1"
  327. " let s:magenta = "5"
  328. " let s:violet = "5".s:bright
  329. " let s:blue = "4"
  330. " let s:cyan = "6"
  331. " let s:green = "2"
  332. let s:base03 = "DarkGray" " 0*
  333. let s:base02 = "Black" " 0
  334. let s:base01 = "LightGreen" " 2*
  335. let s:base00 = "LightYellow" " 3*
  336. let s:base0 = "LightBlue" " 4*
  337. let s:base1 = "LightCyan" " 6*
  338. let s:base2 = "LightGray" " 7
  339. let s:base3 = "White" " 7*
  340. let s:yellow = "DarkYellow" " 3
  341. let s:orange = "LightRed" " 1*
  342. let s:red = "DarkRed" " 1
  343. let s:magenta = "DarkMagenta" " 5
  344. let s:violet = "LightMagenta" " 5*
  345. let s:blue = "DarkBlue" " 4
  346. let s:cyan = "DarkCyan" " 6
  347. let s:green = "DarkGreen" " 2
  348. endif
  349. "}}}
  350. " Formatting options and null values for passthrough effect "{{{
  351. " ---------------------------------------------------------------------
  352. let s:none = "NONE"
  353. let s:none = "NONE"
  354. let s:t_none = "NONE"
  355. let s:n = "NONE"
  356. let s:c = ",undercurl"
  357. let s:r = ",reverse"
  358. let s:s = ",standout"
  359. let s:ou = ""
  360. let s:ob = ""
  361. "}}}
  362. " Background value based on termtrans setting "{{{
  363. " ---------------------------------------------------------------------
  364. if (has("gui_running") || g:solarized_termtrans == 0)
  365. let s:back = s:base03
  366. else
  367. let s:back = "NONE"
  368. endif
  369. "}}}
  370. " Alternate light scheme "{{{
  371. " ---------------------------------------------------------------------
  372. if &background == "light"
  373. let s:temp03 = s:base03
  374. let s:temp02 = s:base02
  375. let s:temp01 = s:base01
  376. let s:temp00 = s:base00
  377. let s:base03 = s:base3
  378. let s:base02 = s:base2
  379. let s:base01 = s:base1
  380. let s:base00 = s:base0
  381. let s:base0 = s:temp00
  382. let s:base1 = s:temp01
  383. let s:base2 = s:temp02
  384. let s:base3 = s:temp03
  385. if (s:back != "NONE")
  386. let s:back = s:base03
  387. endif
  388. endif
  389. "}}}
  390. " Optional contrast schemes "{{{
  391. " ---------------------------------------------------------------------
  392. if g:solarized_contrast == "high"
  393. let s:base01 = s:base00
  394. let s:base00 = s:base0
  395. let s:base0 = s:base1
  396. let s:base1 = s:base2
  397. let s:base2 = s:base3
  398. let s:back = s:back
  399. endif
  400. if g:solarized_contrast == "low"
  401. let s:back = s:base02
  402. let s:ou = ",underline"
  403. endif
  404. "}}}
  405. " Overrides dependent on user specified values and environment "{{{
  406. " ---------------------------------------------------------------------
  407. if (g:solarized_bold == 0 || &t_Co == 8 )
  408. let s:b = ""
  409. let s:bb = ",bold"
  410. else
  411. let s:b = ",bold"
  412. let s:bb = ""
  413. endif
  414. if g:solarized_underline == 0
  415. let s:u = ""
  416. else
  417. let s:u = ",underline"
  418. endif
  419. if g:solarized_italic == 0 || s:terminal_italic == 0
  420. let s:i = ""
  421. else
  422. let s:i = ",italic"
  423. endif
  424. "}}}
  425. " Highlighting primitives"{{{
  426. " ---------------------------------------------------------------------
  427. exe "let s:bg_none = ' ".s:vmode."bg=".s:none ."'"
  428. exe "let s:bg_back = ' ".s:vmode."bg=".s:back ."'"
  429. exe "let s:bg_base03 = ' ".s:vmode."bg=".s:base03 ."'"
  430. exe "let s:bg_base02 = ' ".s:vmode."bg=".s:base02 ."'"
  431. exe "let s:bg_base01 = ' ".s:vmode."bg=".s:base01 ."'"
  432. exe "let s:bg_base00 = ' ".s:vmode."bg=".s:base00 ."'"
  433. exe "let s:bg_base0 = ' ".s:vmode."bg=".s:base0 ."'"
  434. exe "let s:bg_base1 = ' ".s:vmode."bg=".s:base1 ."'"
  435. exe "let s:bg_base2 = ' ".s:vmode."bg=".s:base2 ."'"
  436. exe "let s:bg_base3 = ' ".s:vmode."bg=".s:base3 ."'"
  437. exe "let s:bg_green = ' ".s:vmode."bg=".s:green ."'"
  438. exe "let s:bg_yellow = ' ".s:vmode."bg=".s:yellow ."'"
  439. exe "let s:bg_orange = ' ".s:vmode."bg=".s:orange ."'"
  440. exe "let s:bg_red = ' ".s:vmode."bg=".s:red ."'"
  441. exe "let s:bg_magenta = ' ".s:vmode."bg=".s:magenta."'"
  442. exe "let s:bg_violet = ' ".s:vmode."bg=".s:violet ."'"
  443. exe "let s:bg_blue = ' ".s:vmode."bg=".s:blue ."'"
  444. exe "let s:bg_cyan = ' ".s:vmode."bg=".s:cyan ."'"
  445. exe "let s:fg_none = ' ".s:vmode."fg=".s:none ."'"
  446. exe "let s:fg_back = ' ".s:vmode."fg=".s:back ."'"
  447. exe "let s:fg_base03 = ' ".s:vmode."fg=".s:base03 ."'"
  448. exe "let s:fg_base02 = ' ".s:vmode."fg=".s:base02 ."'"
  449. exe "let s:fg_base01 = ' ".s:vmode."fg=".s:base01 ."'"
  450. exe "let s:fg_base00 = ' ".s:vmode."fg=".s:base00 ."'"
  451. exe "let s:fg_base0 = ' ".s:vmode."fg=".s:base0 ."'"
  452. exe "let s:fg_base1 = ' ".s:vmode."fg=".s:base1 ."'"
  453. exe "let s:fg_base2 = ' ".s:vmode."fg=".s:base2 ."'"
  454. exe "let s:fg_base3 = ' ".s:vmode."fg=".s:base3 ."'"
  455. exe "let s:fg_green = ' ".s:vmode."fg=".s:green ."'"
  456. exe "let s:fg_yellow = ' ".s:vmode."fg=".s:yellow ."'"
  457. exe "let s:fg_orange = ' ".s:vmode."fg=".s:orange ."'"
  458. exe "let s:fg_red = ' ".s:vmode."fg=".s:red ."'"
  459. exe "let s:fg_magenta = ' ".s:vmode."fg=".s:magenta."'"
  460. exe "let s:fg_violet = ' ".s:vmode."fg=".s:violet ."'"
  461. exe "let s:fg_blue = ' ".s:vmode."fg=".s:blue ."'"
  462. exe "let s:fg_cyan = ' ".s:vmode."fg=".s:cyan ."'"
  463. exe "let s:fmt_none = ' ".s:vmode."=NONE". " term=NONE". "'"
  464. exe "let s:fmt_bold = ' ".s:vmode."=NONE".s:b. " term=NONE".s:b."'"
  465. exe "let s:fmt_bldi = ' ".s:vmode."=NONE".s:b. " term=NONE".s:b."'"
  466. exe "let s:fmt_undr = ' ".s:vmode."=NONE".s:u. " term=NONE".s:u."'"
  467. exe "let s:fmt_undb = ' ".s:vmode."=NONE".s:u.s:b. " term=NONE".s:u.s:b."'"
  468. exe "let s:fmt_undi = ' ".s:vmode."=NONE".s:u. " term=NONE".s:u."'"
  469. exe "let s:fmt_uopt = ' ".s:vmode."=NONE".s:ou. " term=NONE".s:ou."'"
  470. exe "let s:fmt_curl = ' ".s:vmode."=NONE".s:c. " term=NONE".s:c."'"
  471. exe "let s:fmt_ital = ' ".s:vmode."=NONE".s:i. " term=NONE".s:i."'"
  472. exe "let s:fmt_stnd = ' ".s:vmode."=NONE".s:s. " term=NONE".s:s."'"
  473. exe "let s:fmt_revr = ' ".s:vmode."=NONE".s:r. " term=NONE".s:r."'"
  474. exe "let s:fmt_revb = ' ".s:vmode."=NONE".s:r.s:b. " term=NONE".s:r.s:b."'"
  475. " revbb (reverse bold for bright colors) is only set to actual bold in low
  476. " color terminals (t_co=8, such as OS X Terminal.app) and should only be used
  477. " with colors 8-15.
  478. exe "let s:fmt_revbb = ' ".s:vmode."=NONE".s:r.s:bb. " term=NONE".s:r.s:bb."'"
  479. exe "let s:fmt_revbbu = ' ".s:vmode."=NONE".s:r.s:bb.s:u." term=NONE".s:r.s:bb.s:u."'"
  480. if has("gui_running")
  481. exe "let s:sp_none = ' guisp=".s:none ."'"
  482. exe "let s:sp_back = ' guisp=".s:back ."'"
  483. exe "let s:sp_base03 = ' guisp=".s:base03 ."'"
  484. exe "let s:sp_base02 = ' guisp=".s:base02 ."'"
  485. exe "let s:sp_base01 = ' guisp=".s:base01 ."'"
  486. exe "let s:sp_base00 = ' guisp=".s:base00 ."'"
  487. exe "let s:sp_base0 = ' guisp=".s:base0 ."'"
  488. exe "let s:sp_base1 = ' guisp=".s:base1 ."'"
  489. exe "let s:sp_base2 = ' guisp=".s:base2 ."'"
  490. exe "let s:sp_base3 = ' guisp=".s:base3 ."'"
  491. exe "let s:sp_green = ' guisp=".s:green ."'"
  492. exe "let s:sp_yellow = ' guisp=".s:yellow ."'"
  493. exe "let s:sp_orange = ' guisp=".s:orange ."'"
  494. exe "let s:sp_red = ' guisp=".s:red ."'"
  495. exe "let s:sp_magenta = ' guisp=".s:magenta."'"
  496. exe "let s:sp_violet = ' guisp=".s:violet ."'"
  497. exe "let s:sp_blue = ' guisp=".s:blue ."'"
  498. exe "let s:sp_cyan = ' guisp=".s:cyan ."'"
  499. else
  500. let s:sp_none = ""
  501. let s:sp_back = ""
  502. let s:sp_base03 = ""
  503. let s:sp_base02 = ""
  504. let s:sp_base01 = ""
  505. let s:sp_base00 = ""
  506. let s:sp_base0 = ""
  507. let s:sp_base1 = ""
  508. let s:sp_base2 = ""
  509. let s:sp_base3 = ""
  510. let s:sp_green = ""
  511. let s:sp_yellow = ""
  512. let s:sp_orange = ""
  513. let s:sp_red = ""
  514. let s:sp_magenta = ""
  515. let s:sp_violet = ""
  516. let s:sp_blue = ""
  517. let s:sp_cyan = ""
  518. endif
  519. "}}}
  520. " Basic highlighting"{{{
  521. " ---------------------------------------------------------------------
  522. " note that link syntax to avoid duplicate configuration doesn't work with the
  523. " exe compiled formats
  524. exe "hi! Normal" .s:fmt_none .s:fg_base0 .s:bg_back
  525. exe "hi! Comment" .s:fmt_ital .s:fg_base01 .s:bg_none
  526. " *Comment any comment
  527. exe "hi! Constant" .s:fmt_none .s:fg_cyan .s:bg_none
  528. " *Constant any constant
  529. " String a string constant: "this is a string"
  530. " Character a character constant: 'c', '\n'
  531. " Number a number constant: 234, 0xff
  532. " Boolean a boolean constant: TRUE, false
  533. " Float a floating point constant: 2.3e10
  534. exe "hi! Identifier" .s:fmt_none .s:fg_blue .s:bg_none
  535. " *Identifier any variable name
  536. " Function function name (also: methods for classes)
  537. "
  538. exe "hi! Statement" .s:fmt_none .s:fg_green .s:bg_none
  539. " *Statement any statement
  540. " Conditional if, then, else, endif, switch, etc.
  541. " Repeat for, do, while, etc.
  542. " Label case, default, etc.
  543. " Operator "sizeof", "+", "*", etc.
  544. " Keyword any other keyword
  545. " Exception try, catch, throw
  546. exe "hi! PreProc" .s:fmt_none .s:fg_orange .s:bg_none
  547. " *PreProc generic Preprocessor
  548. " Include preprocessor #include
  549. " Define preprocessor #define
  550. " Macro same as Define
  551. " PreCondit preprocessor #if, #else, #endif, etc.
  552. exe "hi! Type" .s:fmt_none .s:fg_yellow .s:bg_none
  553. " *Type int, long, char, etc.
  554. " StorageClass static, register, volatile, etc.
  555. " Structure struct, union, enum, etc.
  556. " Typedef A typedef
  557. exe "hi! Special" .s:fmt_none .s:fg_red .s:bg_none
  558. " *Special any special symbol
  559. " SpecialChar special character in a constant
  560. " Tag you can use CTRL-] on this
  561. " Delimiter character that needs attention
  562. " SpecialComment special things inside a comment
  563. " Debug debugging statements
  564. exe "hi! Underlined" .s:fmt_none .s:fg_violet .s:bg_none
  565. " *Underlined text that stands out, HTML links
  566. exe "hi! Ignore" .s:fmt_none .s:fg_none .s:bg_none
  567. " *Ignore left blank, hidden |hl-Ignore|
  568. exe "hi! Error" .s:fmt_bold .s:fg_red .s:bg_none
  569. " *Error any erroneous construct
  570. exe "hi! Todo" .s:fmt_bold .s:fg_magenta.s:bg_none
  571. " *Todo anything that needs extra attention; mostly the
  572. " keywords TODO FIXME and XXX
  573. "
  574. "}}}
  575. " Extended highlighting "{{{
  576. " ---------------------------------------------------------------------
  577. if (g:solarized_visibility=="high")
  578. exe "hi! SpecialKey" .s:fmt_revr .s:fg_red .s:bg_none
  579. exe "hi! NonText" .s:fmt_bold .s:fg_red .s:bg_none
  580. elseif (g:solarized_visibility=="low")
  581. exe "hi! SpecialKey" .s:fmt_bold .s:fg_base02 .s:bg_none
  582. exe "hi! NonText" .s:fmt_bold .s:fg_base02 .s:bg_none
  583. else
  584. exe "hi! SpecialKey" .s:fmt_bold .s:fg_base00 .s:bg_base02
  585. exe "hi! NonText" .s:fmt_bold .s:fg_base00 .s:bg_none
  586. endif
  587. exe "hi! StatusLine" .s:fmt_none .s:fg_base1 .s:bg_base02 .s:fmt_revbb
  588. exe "hi! StatusLineNC" .s:fmt_none .s:fg_base00 .s:bg_base02 .s:fmt_revbb
  589. exe "hi! Visual" .s:fmt_none .s:fg_base01 .s:bg_base03 .s:fmt_revbb
  590. exe "hi! Directory" .s:fmt_none .s:fg_blue .s:bg_none
  591. exe "hi! ErrorMsg" .s:fmt_revr .s:fg_red .s:bg_none
  592. exe "hi! IncSearch" .s:fmt_stnd .s:fg_orange .s:bg_none
  593. exe "hi! Search" .s:fmt_revr .s:fg_yellow .s:bg_none
  594. exe "hi! MoreMsg" .s:fmt_none .s:fg_blue .s:bg_none
  595. exe "hi! ModeMsg" .s:fmt_none .s:fg_blue .s:bg_none
  596. exe "hi! LineNr" .s:fmt_none .s:fg_base01 .s:bg_base02
  597. exe "hi! Question" .s:fmt_bold .s:fg_cyan .s:bg_none
  598. if ( has("gui_running") || &t_Co > 8 )
  599. exe "hi! VertSplit" .s:fmt_none .s:fg_base00 .s:bg_base00
  600. else
  601. exe "hi! VertSplit" .s:fmt_revbb .s:fg_base00 .s:bg_base02
  602. endif
  603. exe "hi! Title" .s:fmt_bold .s:fg_orange .s:bg_none
  604. exe "hi! VisualNOS" .s:fmt_stnd .s:fg_none .s:bg_base02 .s:fmt_revbb
  605. exe "hi! WarningMsg" .s:fmt_bold .s:fg_red .s:bg_none
  606. exe "hi! WildMenu" .s:fmt_none .s:fg_base2 .s:bg_base02 .s:fmt_revbb
  607. exe "hi! Folded" .s:fmt_undb .s:fg_base0 .s:bg_base02 .s:sp_base03
  608. exe "hi! FoldColumn" .s:fmt_none .s:fg_base0 .s:bg_base02
  609. if (g:solarized_diffmode=="high")
  610. exe "hi! DiffAdd" .s:fmt_revr .s:fg_green .s:bg_none
  611. exe "hi! DiffChange" .s:fmt_revr .s:fg_yellow .s:bg_none
  612. exe "hi! DiffDelete" .s:fmt_revr .s:fg_red .s:bg_none
  613. exe "hi! DiffText" .s:fmt_revr .s:fg_blue .s:bg_none
  614. elseif (g:solarized_diffmode=="low")
  615. exe "hi! DiffAdd" .s:fmt_undr .s:fg_green .s:bg_none .s:sp_green
  616. exe "hi! DiffChange" .s:fmt_undr .s:fg_yellow .s:bg_none .s:sp_yellow
  617. exe "hi! DiffDelete" .s:fmt_bold .s:fg_red .s:bg_none
  618. exe "hi! DiffText" .s:fmt_undr .s:fg_blue .s:bg_none .s:sp_blue
  619. else " normal
  620. if has("gui_running")
  621. exe "hi! DiffAdd" .s:fmt_bold .s:fg_green .s:bg_base02 .s:sp_green
  622. exe "hi! DiffChange" .s:fmt_bold .s:fg_yellow .s:bg_base02 .s:sp_yellow
  623. exe "hi! DiffDelete" .s:fmt_bold .s:fg_red .s:bg_base02
  624. exe "hi! DiffText" .s:fmt_bold .s:fg_blue .s:bg_base02 .s:sp_blue
  625. else
  626. exe "hi! DiffAdd" .s:fmt_none .s:fg_green .s:bg_base02 .s:sp_green
  627. exe "hi! DiffChange" .s:fmt_none .s:fg_yellow .s:bg_base02 .s:sp_yellow
  628. exe "hi! DiffDelete" .s:fmt_none .s:fg_red .s:bg_base02
  629. exe "hi! DiffText" .s:fmt_none .s:fg_blue .s:bg_base02 .s:sp_blue
  630. endif
  631. endif
  632. exe "hi! SignColumn" .s:fmt_none .s:fg_base0
  633. exe "hi! Conceal" .s:fmt_none .s:fg_blue .s:bg_none
  634. exe "hi! SpellBad" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_red
  635. exe "hi! SpellCap" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_violet
  636. exe "hi! SpellRare" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_cyan
  637. exe "hi! SpellLocal" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_yellow
  638. exe "hi! Pmenu" .s:fmt_none .s:fg_base0 .s:bg_base02 .s:fmt_revbb
  639. exe "hi! PmenuSel" .s:fmt_none .s:fg_base01 .s:bg_base2 .s:fmt_revbb
  640. exe "hi! PmenuSbar" .s:fmt_none .s:fg_base2 .s:bg_base0 .s:fmt_revbb
  641. exe "hi! PmenuThumb" .s:fmt_none .s:fg_base0 .s:bg_base03 .s:fmt_revbb
  642. exe "hi! TabLine" .s:fmt_undr .s:fg_base0 .s:bg_base02 .s:sp_base0
  643. exe "hi! TabLineFill" .s:fmt_undr .s:fg_base0 .s:bg_base02 .s:sp_base0
  644. exe "hi! TabLineSel" .s:fmt_undr .s:fg_base01 .s:bg_base2 .s:sp_base0 .s:fmt_revbbu
  645. exe "hi! CursorColumn" .s:fmt_none .s:fg_none .s:bg_base02
  646. exe "hi! CursorLine" .s:fmt_uopt .s:fg_none .s:bg_base02 .s:sp_base1
  647. exe "hi! ColorColumn" .s:fmt_none .s:fg_none .s:bg_base02
  648. exe "hi! Cursor" .s:fmt_none .s:fg_base03 .s:bg_base0
  649. hi! link lCursor Cursor
  650. exe "hi! MatchParen" .s:fmt_bold .s:fg_red .s:bg_base01
  651. "}}}
  652. " vim syntax highlighting "{{{
  653. " ---------------------------------------------------------------------
  654. "exe "hi! vimLineComment" . s:fg_base01 .s:bg_none .s:fmt_ital
  655. "hi! link vimComment Comment
  656. "hi! link vimLineComment Comment
  657. hi! link vimVar Identifier
  658. hi! link vimFunc Function
  659. hi! link vimUserFunc Function
  660. hi! link helpSpecial Special
  661. hi! link vimSet Normal
  662. hi! link vimSetEqual Normal
  663. exe "hi! vimCommentString" .s:fmt_none .s:fg_violet .s:bg_none
  664. exe "hi! vimCommand" .s:fmt_none .s:fg_yellow .s:bg_none
  665. exe "hi! vimCmdSep" .s:fmt_bold .s:fg_blue .s:bg_none
  666. exe "hi! helpExample" .s:fmt_none .s:fg_base1 .s:bg_none
  667. exe "hi! helpOption" .s:fmt_none .s:fg_cyan .s:bg_none
  668. exe "hi! helpNote" .s:fmt_none .s:fg_magenta.s:bg_none
  669. exe "hi! helpVim" .s:fmt_none .s:fg_magenta.s:bg_none
  670. exe "hi! helpHyperTextJump" .s:fmt_undr .s:fg_blue .s:bg_none
  671. exe "hi! helpHyperTextEntry".s:fmt_none .s:fg_green .s:bg_none
  672. exe "hi! vimIsCommand" .s:fmt_none .s:fg_base00 .s:bg_none
  673. exe "hi! vimSynMtchOpt" .s:fmt_none .s:fg_yellow .s:bg_none
  674. exe "hi! vimSynType" .s:fmt_none .s:fg_cyan .s:bg_none
  675. exe "hi! vimHiLink" .s:fmt_none .s:fg_blue .s:bg_none
  676. exe "hi! vimHiGroup" .s:fmt_none .s:fg_blue .s:bg_none
  677. exe "hi! vimGroup" .s:fmt_undb .s:fg_blue .s:bg_none
  678. "}}}
  679. " diff highlighting "{{{
  680. " ---------------------------------------------------------------------
  681. hi! link diffAdded Statement
  682. hi! link diffLine Identifier
  683. "}}}
  684. " git & gitcommit highlighting "{{{
  685. "git
  686. "exe "hi! gitDateHeader"
  687. "exe "hi! gitIdentityHeader"
  688. "exe "hi! gitIdentityKeyword"
  689. "exe "hi! gitNotesHeader"
  690. "exe "hi! gitReflogHeader"
  691. "exe "hi! gitKeyword"
  692. "exe "hi! gitIdentity"
  693. "exe "hi! gitEmailDelimiter"
  694. "exe "hi! gitEmail"
  695. "exe "hi! gitDate"
  696. "exe "hi! gitMode"
  697. "exe "hi! gitHashAbbrev"
  698. "exe "hi! gitHash"
  699. "exe "hi! gitReflogMiddle"
  700. "exe "hi! gitReference"
  701. "exe "hi! gitStage"
  702. "exe "hi! gitType"
  703. "exe "hi! gitDiffAdded"
  704. "exe "hi! gitDiffRemoved"
  705. "gitcommit
  706. "exe "hi! gitcommitSummary"
  707. exe "hi! gitcommitComment" .s:fmt_ital .s:fg_base01 .s:bg_none
  708. hi! link gitcommitUntracked gitcommitComment
  709. hi! link gitcommitDiscarded gitcommitComment
  710. hi! link gitcommitSelected gitcommitComment
  711. exe "hi! gitcommitUnmerged" .s:fmt_bold .s:fg_green .s:bg_none
  712. exe "hi! gitcommitOnBranch" .s:fmt_bold .s:fg_base01 .s:bg_none
  713. exe "hi! gitcommitBranch" .s:fmt_bold .s:fg_magenta .s:bg_none
  714. hi! link gitcommitNoBranch gitcommitBranch
  715. exe "hi! gitcommitDiscardedType".s:fmt_none .s:fg_red .s:bg_none
  716. exe "hi! gitcommitSelectedType" .s:fmt_none .s:fg_green .s:bg_none
  717. "exe "hi! gitcommitUnmergedType"
  718. "exe "hi! gitcommitType"
  719. "exe "hi! gitcommitNoChanges"
  720. "exe "hi! gitcommitHeader"
  721. exe "hi! gitcommitHeader" .s:fmt_none .s:fg_base01 .s:bg_none
  722. exe "hi! gitcommitUntrackedFile".s:fmt_bold .s:fg_cyan .s:bg_none
  723. exe "hi! gitcommitDiscardedFile".s:fmt_bold .s:fg_red .s:bg_none
  724. exe "hi! gitcommitSelectedFile" .s:fmt_bold .s:fg_green .s:bg_none
  725. exe "hi! gitcommitUnmergedFile" .s:fmt_bold .s:fg_yellow .s:bg_none
  726. exe "hi! gitcommitFile" .s:fmt_bold .s:fg_base0 .s:bg_none
  727. hi! link gitcommitDiscardedArrow gitcommitDiscardedFile
  728. hi! link gitcommitSelectedArrow gitcommitSelectedFile
  729. hi! link gitcommitUnmergedArrow gitcommitUnmergedFile
  730. "exe "hi! gitcommitArrow"
  731. "exe "hi! gitcommitOverflow"
  732. "exe "hi! gitcommitBlank"
  733. " }}}
  734. " html highlighting "{{{
  735. " ---------------------------------------------------------------------
  736. exe "hi! htmlTag" .s:fmt_none .s:fg_base01 .s:bg_none
  737. exe "hi! htmlEndTag" .s:fmt_none .s:fg_base01 .s:bg_none
  738. exe "hi! htmlTagN" .s:fmt_bold .s:fg_base1 .s:bg_none
  739. exe "hi! htmlTagName" .s:fmt_bold .s:fg_blue .s:bg_none
  740. exe "hi! htmlSpecialTagName".s:fmt_ital .s:fg_blue .s:bg_none
  741. exe "hi! htmlArg" .s:fmt_none .s:fg_base00 .s:bg_none
  742. exe "hi! javaScript" .s:fmt_none .s:fg_yellow .s:bg_none
  743. "}}}
  744. " perl highlighting "{{{
  745. " ---------------------------------------------------------------------
  746. exe "hi! perlHereDoc" . s:fg_base1 .s:bg_back .s:fmt_none
  747. exe "hi! perlVarPlain" . s:fg_yellow .s:bg_back .s:fmt_none
  748. exe "hi! perlStatementFileDesc". s:fg_cyan.s:bg_back.s:fmt_none
  749. "}}}
  750. " tex highlighting "{{{
  751. " ---------------------------------------------------------------------
  752. exe "hi! texStatement" . s:fg_cyan .s:bg_back .s:fmt_none
  753. exe "hi! texMathZoneX" . s:fg_yellow .s:bg_back .s:fmt_none
  754. exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back .s:fmt_none
  755. exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back .s:fmt_none
  756. exe "hi! texRefLabel" . s:fg_yellow .s:bg_back .s:fmt_none
  757. "}}}
  758. " ruby highlighting "{{{
  759. " ---------------------------------------------------------------------
  760. exe "hi! rubyDefine" . s:fg_base1 .s:bg_back .s:fmt_bold
  761. "rubyInclude
  762. "rubySharpBang
  763. "rubyAccess
  764. "rubyPredefinedVariable
  765. "rubyBoolean
  766. "rubyClassVariable
  767. "rubyBeginEnd
  768. "rubyRepeatModifier
  769. "hi! link rubyArrayDelimiter Special " [ , , ]
  770. "rubyCurlyBlock { , , }
  771. "hi! link rubyClass Keyword
  772. "hi! link rubyModule Keyword
  773. "hi! link rubyKeyword Keyword
  774. "hi! link rubyOperator Operator
  775. "hi! link rubyIdentifier Identifier
  776. "hi! link rubyInstanceVariable Identifier
  777. "hi! link rubyGlobalVariable Identifier
  778. "hi! link rubyClassVariable Identifier
  779. "hi! link rubyConstant Type
  780. "}}}
  781. " haskell syntax highlighting"{{{
  782. " ---------------------------------------------------------------------
  783. " For use with syntax/haskell.vim : Haskell Syntax File
  784. " http://www.vim.org/scripts/script.php?script_id=3034
  785. " See also Steffen Siering's github repository:
  786. " http://github.com/urso/dotrc/blob/master/vim/syntax/haskell.vim
  787. " ---------------------------------------------------------------------
  788. "
  789. " Treat True and False specially, see the plugin referenced above
  790. let hs_highlight_boolean=1
  791. " highlight delims, see the plugin referenced above
  792. let hs_highlight_delimiters=1
  793. exe "hi! cPreCondit". s:fg_orange.s:bg_none .s:fmt_none
  794. exe "hi! VarId" . s:fg_blue .s:bg_none .s:fmt_none
  795. exe "hi! ConId" . s:fg_yellow .s:bg_none .s:fmt_none
  796. exe "hi! hsImport" . s:fg_magenta.s:bg_none .s:fmt_none
  797. exe "hi! hsString" . s:fg_base00 .s:bg_none .s:fmt_none
  798. exe "hi! hsStructure" . s:fg_cyan .s:bg_none .s:fmt_none
  799. exe "hi! hs_hlFunctionName" . s:fg_blue .s:bg_none
  800. exe "hi! hsStatement" . s:fg_cyan .s:bg_none .s:fmt_none
  801. exe "hi! hsImportLabel" . s:fg_cyan .s:bg_none .s:fmt_none
  802. exe "hi! hs_OpFunctionName" . s:fg_yellow .s:bg_none .s:fmt_none
  803. exe "hi! hs_DeclareFunction" . s:fg_orange .s:bg_none .s:fmt_none
  804. exe "hi! hsVarSym" . s:fg_cyan .s:bg_none .s:fmt_none
  805. exe "hi! hsType" . s:fg_yellow .s:bg_none .s:fmt_none
  806. exe "hi! hsTypedef" . s:fg_cyan .s:bg_none .s:fmt_none
  807. exe "hi! hsModuleName" . s:fg_green .s:bg_none .s:fmt_undr
  808. exe "hi! hsModuleStartLabel" . s:fg_magenta.s:bg_none .s:fmt_none
  809. hi! link hsImportParams Delimiter
  810. hi! link hsDelimTypeExport Delimiter
  811. hi! link hsModuleStartLabel hsStructure
  812. hi! link hsModuleWhereLabel hsModuleStartLabel
  813. " following is for the haskell-conceal plugin
  814. " the first two items don't have an impact, but better safe
  815. exe "hi! hsNiceOperator" . s:fg_cyan .s:bg_none .s:fmt_none
  816. exe "hi! hsniceoperator" . s:fg_cyan .s:bg_none .s:fmt_none
  817. "}}}
  818. " pandoc markdown syntax highlighting "{{{
  819. " ---------------------------------------------------------------------
  820. "PandocHiLink pandocNormalBlock
  821. exe "hi! pandocTitleBlock" .s:fg_blue .s:bg_none .s:fmt_none
  822. exe "hi! pandocTitleBlockTitle" .s:fg_blue .s:bg_none .s:fmt_bold
  823. exe "hi! pandocTitleComment" .s:fg_blue .s:bg_none .s:fmt_bold
  824. exe "hi! pandocComment" .s:fg_base01 .s:bg_none .s:fmt_ital
  825. exe "hi! pandocVerbatimBlock" .s:fg_yellow .s:bg_none .s:fmt_none
  826. hi! link pandocVerbatimBlockDeep pandocVerbatimBlock
  827. hi! link pandocCodeBlock pandocVerbatimBlock
  828. hi! link pandocCodeBlockDelim pandocVerbatimBlock
  829. exe "hi! pandocBlockQuote" .s:fg_blue .s:bg_none .s:fmt_none
  830. exe "hi! pandocBlockQuoteLeader1" .s:fg_blue .s:bg_none .s:fmt_none
  831. exe "hi! pandocBlockQuoteLeader2" .s:fg_cyan .s:bg_none .s:fmt_none
  832. exe "hi! pandocBlockQuoteLeader3" .s:fg_yellow .s:bg_none .s:fmt_none
  833. exe "hi! pandocBlockQuoteLeader4" .s:fg_red .s:bg_none .s:fmt_none
  834. exe "hi! pandocBlockQuoteLeader5" .s:fg_base0 .s:bg_none .s:fmt_none
  835. exe "hi! pandocBlockQuoteLeader6" .s:fg_base01 .s:bg_none .s:fmt_none
  836. exe "hi! pandocListMarker" .s:fg_magenta.s:bg_none .s:fmt_none
  837. exe "hi! pandocListReference" .s:fg_magenta.s:bg_none .s:fmt_undr
  838. " Definitions
  839. " ---------------------------------------------------------------------
  840. let s:fg_pdef = s:fg_violet
  841. exe "hi! pandocDefinitionBlock" .s:fg_pdef .s:bg_none .s:fmt_none
  842. exe "hi! pandocDefinitionTerm" .s:fg_pdef .s:bg_none .s:fmt_stnd
  843. exe "hi! pandocDefinitionIndctr" .s:fg_pdef .s:bg_none .s:fmt_bold
  844. exe "hi! pandocEmphasisDefinition" .s:fg_pdef .s:bg_none .s:fmt_ital
  845. exe "hi! pandocEmphasisNestedDefinition" .s:fg_pdef .s:bg_none .s:fmt_bldi
  846. exe "hi! pandocStrongEmphasisDefinition" .s:fg_pdef .s:bg_none .s:fmt_bold
  847. exe "hi! pandocStrongEmphasisNestedDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi
  848. exe "hi! pandocStrongEmphasisEmphasisDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi
  849. exe "hi! pandocStrikeoutDefinition" .s:fg_pdef .s:bg_none .s:fmt_revr
  850. exe "hi! pandocVerbatimInlineDefinition" .s:fg_pdef .s:bg_none .s:fmt_none
  851. exe "hi! pandocSuperscriptDefinition" .s:fg_pdef .s:bg_none .s:fmt_none
  852. exe "hi! pandocSubscriptDefinition" .s:fg_pdef .s:bg_none .s:fmt_none
  853. " Tables
  854. " ---------------------------------------------------------------------
  855. let s:fg_ptable = s:fg_blue
  856. exe "hi! pandocTable" .s:fg_ptable.s:bg_none .s:fmt_none
  857. exe "hi! pandocTableStructure" .s:fg_ptable.s:bg_none .s:fmt_none
  858. hi! link pandocTableStructureTop pandocTableStructre
  859. hi! link pandocTableStructureEnd pandocTableStructre
  860. exe "hi! pandocTableZebraLight" .s:fg_ptable.s:bg_base03.s:fmt_none
  861. exe "hi! pandocTableZebraDark" .s:fg_ptable.s:bg_base02.s:fmt_none
  862. exe "hi! pandocEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_ital
  863. exe "hi! pandocEmphasisNestedTable" .s:fg_ptable.s:bg_none .s:fmt_bldi
  864. exe "hi! pandocStrongEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_bold
  865. exe "hi! pandocStrongEmphasisNestedTable" .s:fg_ptable.s:bg_none .s:fmt_bldi
  866. exe "hi! pandocStrongEmphasisEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_bldi
  867. exe "hi! pandocStrikeoutTable" .s:fg_ptable.s:bg_none .s:fmt_revr
  868. exe "hi! pandocVerbatimInlineTable" .s:fg_ptable.s:bg_none .s:fmt_none
  869. exe "hi! pandocSuperscriptTable" .s:fg_ptable.s:bg_none .s:fmt_none
  870. exe "hi! pandocSubscriptTable" .s:fg_ptable.s:bg_none .s:fmt_none
  871. " Headings
  872. " ---------------------------------------------------------------------
  873. let s:fg_phead = s:fg_orange
  874. exe "hi! pandocHeading" .s:fg_phead .s:bg_none.s:fmt_bold
  875. exe "hi! pandocHeadingMarker" .s:fg_yellow.s:bg_none.s:fmt_bold
  876. exe "hi! pandocEmphasisHeading" .s:fg_phead .s:bg_none.s:fmt_bldi
  877. exe "hi! pandocEmphasisNestedHeading" .s:fg_phead .s:bg_none.s:fmt_bldi
  878. exe "hi! pandocStrongEmphasisHeading" .s:fg_phead .s:bg_none.s:fmt_bold
  879. exe "hi! pandocStrongEmphasisNestedHeading" .s:fg_phead .s:bg_none.s:fmt_bldi
  880. exe "hi! pandocStrongEmphasisEmphasisHeading".s:fg_phead .s:bg_none.s:fmt_bldi
  881. exe "hi! pandocStrikeoutHeading" .s:fg_phead .s:bg_none.s:fmt_revr
  882. exe "hi! pandocVerbatimInlineHeading" .s:fg_phead .s:bg_none.s:fmt_bold
  883. exe "hi! pandocSuperscriptHeading" .s:fg_phead .s:bg_none.s:fmt_bold
  884. exe "hi! pandocSubscriptHeading" .s:fg_phead .s:bg_none.s:fmt_bold
  885. " Links
  886. " ---------------------------------------------------------------------
  887. exe "hi! pandocLinkDelim" .s:fg_base01 .s:bg_none .s:fmt_none
  888. exe "hi! pandocLinkLabel" .s:fg_blue .s:bg_none .s:fmt_undr
  889. exe "hi! pandocLinkText" .s:fg_blue .s:bg_none .s:fmt_undb
  890. exe "hi! pandocLinkURL" .s:fg_base00 .s:bg_none .s:fmt_undr
  891. exe "hi! pandocLinkTitle" .s:fg_base00 .s:bg_none .s:fmt_undi
  892. exe "hi! pandocLinkTitleDelim" .s:fg_base01 .s:bg_none .s:fmt_undi .s:sp_base00
  893. exe "hi! pandocLinkDefinition" .s:fg_cyan .s:bg_none .s:fmt_undr .s:sp_base00
  894. exe "hi! pandocLinkDefinitionID" .s:fg_blue .s:bg_none .s:fmt_bold
  895. exe "hi! pandocImageCaption" .s:fg_violet .s:bg_none .s:fmt_undb
  896. exe "hi! pandocFootnoteLink" .s:fg_green .s:bg_none .s:fmt_undr
  897. exe "hi! pandocFootnoteDefLink" .s:fg_green .s:bg_none .s:fmt_bold
  898. exe "hi! pandocFootnoteInline" .s:fg_green .s:bg_none .s:fmt_undb
  899. exe "hi! pandocFootnote" .s:fg_green .s:bg_none .s:fmt_none
  900. exe "hi! pandocCitationDelim" .s:fg_magenta.s:bg_none .s:fmt_none
  901. exe "hi! pandocCitation" .s:fg_magenta.s:bg_none .s:fmt_none
  902. exe "hi! pandocCitationID" .s:fg_magenta.s:bg_none .s:fmt_undr
  903. exe "hi! pandocCitationRef" .s:fg_magenta.s:bg_none .s:fmt_none
  904. " Main Styles
  905. " ---------------------------------------------------------------------
  906. exe "hi! pandocStyleDelim" .s:fg_base01 .s:bg_none .s:fmt_none
  907. exe "hi! pandocEmphasis" .s:fg_base0 .s:bg_none .s:fmt_ital
  908. exe "hi! pandocEmphasisNested" .s:fg_base0 .s:bg_none .s:fmt_bldi
  909. exe "hi! pandocStrongEmphasis" .s:fg_base0 .s:bg_none .s:fmt_bold
  910. exe "hi! pandocStrongEmphasisNested" .s:fg_base0 .s:bg_none .s:fmt_bldi
  911. exe "hi! pandocStrongEmphasisEmphasis" .s:fg_base0 .s:bg_none .s:fmt_bldi
  912. exe "hi! pandocStrikeout" .s:fg_base01 .s:bg_none .s:fmt_revr
  913. exe "hi! pandocVerbatimInline" .s:fg_yellow .s:bg_none .s:fmt_none
  914. exe "hi! pandocSuperscript" .s:fg_violet .s:bg_none .s:fmt_none
  915. exe "hi! pandocSubscript" .s:fg_violet .s:bg_none .s:fmt_none
  916. exe "hi! pandocRule" .s:fg_blue .s:bg_none .s:fmt_bold
  917. exe "hi! pandocRuleLine" .s:fg_blue .s:bg_none .s:fmt_bold
  918. exe "hi! pandocEscapePair" .s:fg_red .s:bg_none .s:fmt_bold
  919. exe "hi! pandocCitationRef" .s:fg_magenta.s:bg_none .s:fmt_none
  920. exe "hi! pandocNonBreakingSpace" . s:fg_red .s:bg_none .s:fmt_revr
  921. hi! link pandocEscapedCharacter pandocEscapePair
  922. hi! link pandocLineBreak pandocEscapePair
  923. " Embedded Code
  924. " ---------------------------------------------------------------------
  925. exe "hi! pandocMetadataDelim" .s:fg_base01 .s:bg_none .s:fmt_none
  926. exe "hi! pandocMetadata" .s:fg_blue .s:bg_none .s:fmt_none
  927. exe "hi! pandocMetadataKey" .s:fg_blue .s:bg_none .s:fmt_none
  928. exe "hi! pandocMetadata" .s:fg_blue .s:bg_none .s:fmt_bold
  929. hi! link pandocMetadataTitle pandocMetadata
  930. "}}}
  931. " Utility autocommand "{{{
  932. " ---------------------------------------------------------------------
  933. " In cases where Solarized is initialized inside a terminal vim session and
  934. " then transferred to a gui session via the command `:gui`, the gui vim process
  935. " does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui`
  936. " related code that sets gui specific values isn't executed.
  937. "
  938. " Currently, Solarized sets only the cterm or gui values for the colorscheme
  939. " depending on gui or terminal mode. It's possible that, if the following
  940. " autocommand method is deemed excessively poor form, that approach will be
  941. " used again and the autocommand below will be dropped.
  942. "
  943. " However it seems relatively benign in this case to include the autocommand
  944. " here. It fires only in cases where vim is transferring from terminal to gui
  945. " mode (detected with the script scope s:vmode variable). It also allows for
  946. " other potential terminal customizations that might make gui mode suboptimal.
  947. "
  948. autocmd GUIEnter * if (s:vmode != "gui") | exe "colorscheme " . g:colors_name | endif
  949. "}}}
  950. " Highlight Trailing Space {{{
  951. " Experimental: Different highlight when on cursorline
  952. function! s:SolarizedHiTrail()
  953. if g:solarized_hitrail==0
  954. hi! clear solarizedTrailingSpace
  955. else
  956. syn match solarizedTrailingSpace "\s*$"
  957. exe "hi! solarizedTrailingSpace " .s:fmt_undr .s:fg_red .s:bg_none .s:sp_red
  958. endif
  959. endfunction
  960. augroup SolarizedHiTrail
  961. autocmd!
  962. if g:solarized_hitrail==1
  963. autocmd! Syntax * call s:SolarizedHiTrail()
  964. autocmd! ColorScheme * if g:colors_name == "solarized" | call s:SolarizedHiTrail() | else | augroup! s:SolarizedHiTrail | endif
  965. endif
  966. augroup END
  967. " }}}
  968. " Menus "{{{
  969. " ---------------------------------------------------------------------
  970. " Turn off Solarized menu by including the following assignment in your .vimrc:
  971. "
  972. " let g:solarized_menu=0
  973. function! s:SolarizedOptions()
  974. new "new buffer
  975. setf vim "vim filetype
  976. let failed = append(0, s:defaults_list)
  977. let failed = append(0, s:colorscheme_list)
  978. let failed = append(0, s:options_list)
  979. let failed = append(0, s:lazycat_list)
  980. 0 "jump back to the top
  981. endfunction
  982. if !exists(":SolarizedOptions")
  983. command SolarizedOptions :call s:SolarizedOptions()
  984. endif
  985. function! SolarizedMenu()
  986. if exists("g:loaded_solarized_menu")
  987. try
  988. silent! aunmenu Solarized
  989. endtry
  990. endif
  991. let g:loaded_solarized_menu = 1
  992. if g:colors_name == "solarized" && g:solarized_menu != 0
  993. amenu &Solarized.&Contrast.&Low\ Contrast :let g:solarized_contrast="low" \| colorscheme solarized<CR>
  994. amenu &Solarized.&Contrast.&Normal\ Contrast :let g:solarized_contrast="normal" \| colorscheme solarized<CR>
  995. amenu &Solarized.&Contrast.&High\ Contrast :let g:solarized_contrast="high" \| colorscheme solarized<CR>
  996. an &Solarized.&Contrast.-sep- <Nop>
  997. amenu &Solarized.&Contrast.&Help:\ Contrast :help 'solarized_contrast'<CR>
  998. amenu &Solarized.&Visibility.&Low\ Visibility :let g:solarized_visibility="low" \| colorscheme solarized<CR>
  999. amenu &Solarized.&Visibility.&Normal\ Visibility :let g:solarized_visibility="normal" \| colorscheme solarized<CR>
  1000. amenu &Solarized.&Visibility.&High\ Visibility :let g:solarized_visibility="high" \| colorscheme solarized<CR>
  1001. an &Solarized.&Visibility.-sep- <Nop>
  1002. amenu &Solarized.&Visibility.&Help:\ Visibility :help 'solarized_visibility'<CR>
  1003. amenu &Solarized.&Background.&Toggle\ Background :ToggleBG<CR>
  1004. amenu &Solarized.&Background.&Dark\ Background :set background=dark \| colorscheme solarized<CR>
  1005. amenu &Solarized.&Background.&Light\ Background :set background=light \| colorscheme solarized<CR>
  1006. an &Solarized.&Background.-sep- <Nop>
  1007. amenu &Solarized.&Background.&Help:\ ToggleBG :help togglebg<CR>
  1008. if g:solarized_bold==0 | let l:boldswitch="On" | else | let l:boldswitch="Off" | endif
  1009. exe "amenu &Solarized.&Styling.&Turn\\ Bold\\ ".l:boldswitch." :let g:solarized_bold=(abs(g:solarized_bold-1)) \\| colorscheme solarized<CR>"
  1010. if g:solarized_italic==0 | let l:italicswitch="On" | else | let l:italicswitch="Off" | endif
  1011. exe "amenu &Solarized.&Styling.&Turn\\ Italic\\ ".l:italicswitch." :let g:solarized_italic=(abs(g:solarized_italic-1)) \\| colorscheme solarized<CR>"
  1012. if g:solarized_underline==0 | let l:underlineswitch="On" | else | let l:underlineswitch="Off" | endif
  1013. exe "amenu &Solarized.&Styling.&Turn\\ Underline\\ ".l:underlineswitch." :let g:solarized_underline=(abs(g:solarized_underline-1)) \\| colorscheme solarized<CR>"
  1014. amenu &Solarized.&Diff\ Mode.&Low\ Diff\ Mode :let g:solarized_diffmode="low" \| colorscheme solarized<CR>
  1015. amenu &Solarized.&Diff\ Mode.&Normal\ Diff\ Mode :let g:solarized_diffmode="normal" \| colorscheme solarized<CR>
  1016. amenu &Solarized.&Diff\ Mode.&High\ Diff\ Mode :let g:solarized_diffmode="high" \| colorscheme solarized<CR>
  1017. if g:solarized_hitrail==0 | let l:hitrailswitch="On" | else | let l:hitrailswitch="Off" | endif
  1018. exe "amenu &Solarized.&Experimental.&Turn\\ Highlight\\ Trailing\\ Spaces\\ ".l:hitrailswitch." :let g:solarized_hitrail=(abs(g:solarized_hitrail-1)) \\| colorscheme solarized<CR>"
  1019. an &Solarized.&Experimental.-sep- <Nop>
  1020. amenu &Solarized.&Experimental.&Help:\ HiTrail :help 'solarized_hitrail'<CR>
  1021. an &Solarized.-sep1- <Nop>
  1022. amenu &Solarized.&Autogenerate\ options :SolarizedOptions<CR>
  1023. an &Solarized.-sep2- <Nop>
  1024. amenu &Solarized.&Help.&Solarized\ Help :help solarized<CR>
  1025. amenu &Solarized.&Help.&Toggle\ Background\ Help :help togglebg<CR>
  1026. amenu &Solarized.&Help.&Removing\ This\ Menu :help solarized-menu<CR>
  1027. an 9999.77 &Help.&Solarized\ Colorscheme :help solarized<CR>
  1028. an 9999.78 &Help.&Toggle\ Background :help togglebg<CR>
  1029. an 9999.79 &Help.-sep3- <Nop>
  1030. endif
  1031. endfunction
  1032. autocmd ColorScheme * if g:colors_name != "solarized" | silent! aunmenu Solarized | else | call SolarizedMenu() | endif
  1033. "}}}
  1034. " License "{{{
  1035. " ---------------------------------------------------------------------
  1036. "
  1037. " Copyright (c) 2011 Ethan Schoonover
  1038. "
  1039. " Permission is hereby granted, free of charge, to any person obtaining a copy
  1040. " of this software and associated documentation files (the "Software"), to deal
  1041. " in the Software without restriction, including without limitation the rights
  1042. " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1043. " copies of the Software, and to permit persons to whom the Software is
  1044. " furnished to do so, subject to the following conditions:
  1045. "
  1046. " The above copyright notice and this permission notice shall be included in
  1047. " all copies or substantial portions of the Software.
  1048. "
  1049. " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1050. " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1051. " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1052. " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1053. " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1054. " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1055. " THE SOFTWARE.
  1056. "
  1057. " vim:foldmethod=marker:foldlevel=0
  1058. "}}}