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