4 " " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ "
5 " " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| "
6 " " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ "
7 " " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ "
10 " "A colorful, dark color scheme for Vim."
12 " File: jellybeans.vim
13 " Maintainer: NanoTech <http://nanotech.nanotechcorp.net/>
15 " Last Change: January 15th, 2012
16 " Contributors: Daniel Herbert <http://pocket-ninja.com/>,
17 " Henry So, Jr. <henryso@panix.com>,
18 " David Liang <bmdavll at gmail dot com>,
19 " Rich Healey (richoH),
22 " Copyright (c) 2009-2012 NanoTech
24 " Permission is hereby granted, free of charge, to any person obtaining a copy
25 " of this software and associated documentation files (the "Software"), to deal
26 " in the Software without restriction, including without limitation the rights
27 " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28 " copies of the Software, and to permit persons to whom the Software is
29 " furnished to do so, subject to the following conditions:
31 " The above copyright notice and this permission notice shall be included in
32 " all copies or substantial portions of the Software.
34 " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
46 if exists("syntax_on")
50 let colors_name = "jellybeans"
52 if has("gui_running") || &t_Co == 88 || &t_Co == 256
58 " Color approximation functions by Henry So, Jr. and David Liang {{{
59 " Added to jellybeans.vim by Daniel Herbert
61 " returns an approximate grey index for the given grey level
89 let l:n = (a:x - 8) / 10
90 let l:m = (a:x - 8) % 10
100 " returns the actual grey level represented by the grey index
128 return 8 + (a:n * 10)
133 " returns the palette index for the given grey index
154 " returns an approximate color index for the given color level
170 let l:n = (a:x - 55) / 40
171 let l:m = (a:x - 55) % 40
181 " returns the actual color level for the given color index
197 return 55 + (a:n * 40)
202 " returns the palette index for the given R/G/B color indices
203 fun! s:rgb_color(x, y, z)
205 return 16 + (a:x * 16) + (a:y * 4) + a:z
207 return 16 + (a:x * 36) + (a:y * 6) + a:z
211 " returns the palette index to approximate the given R/G/B color levels
212 fun! s:color(r, g, b)
213 " get the closest grey
214 let l:gx = s:grey_number(a:r)
215 let l:gy = s:grey_number(a:g)
216 let l:gz = s:grey_number(a:b)
218 " get the closest color
219 let l:x = s:rgb_number(a:r)
220 let l:y = s:rgb_number(a:g)
221 let l:z = s:rgb_number(a:b)
223 if l:gx == l:gy && l:gy == l:gz
224 " there are two possibilities
225 let l:dgr = s:grey_level(l:gx) - a:r
226 let l:dgg = s:grey_level(l:gy) - a:g
227 let l:dgb = s:grey_level(l:gz) - a:b
228 let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
229 let l:dr = s:rgb_level(l:gx) - a:r
230 let l:dg = s:rgb_level(l:gy) - a:g
231 let l:db = s:rgb_level(l:gz) - a:b
232 let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
235 return s:grey_color(l:gx)
238 return s:rgb_color(l:x, l:y, l:z)
241 " only one possibility
242 return s:rgb_color(l:x, l:y, l:z)
246 " returns the palette index to approximate the 'rrggbb' hex string
248 let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
249 let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
250 let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
251 return s:color(l:r, l:g, l:b)
254 " sets the highlighting for the given group
255 fun! s:X(group, fg, bg, attr, lcfg, lcbg)
257 let l:fge = empty(a:lcfg)
258 let l:bge = empty(a:lcbg)
261 exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg
262 elseif !l:fge && l:bge
263 exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE"
264 elseif l:fge && !l:bge
265 exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg
268 let l:fge = empty(a:fg)
269 let l:bge = empty(a:bg)
272 exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg)
273 elseif !l:fge && l:bge
274 exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE"
275 elseif l:fge && !l:bge
276 exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg)
281 exec "hi ".a:group." gui=none cterm=none"
283 let noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
285 let noitalic = "none"
287 exec "hi ".a:group." gui=".a:attr." cterm=".noitalic
292 call s:X("Normal","e8e8d3","151515","","White","")
295 if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black
296 let s:termBlack = "Black"
298 let s:termBlack = "Grey"
302 call s:X("CursorLine","","1c1c1c","","",s:termBlack)
303 call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
304 call s:X("MatchParen","ffffff","80a090","bold","","DarkCyan")
306 call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
307 call s:X("TabLineFill","9098a0","","","",s:termBlack)
308 call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
311 call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
312 call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
315 call s:X("Visual","","404040","","",s:termBlack)
316 call s:X("Cursor","","b0d0f0","","","")
318 call s:X("LineNr","605958","151515","none",s:termBlack,"")
319 call s:X("Comment","888888","","italic","Grey","")
320 call s:X("Todo","808080","","bold","White",s:termBlack)
322 call s:X("StatusLine","000000","dddddd","italic","","White")
323 call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
324 call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
325 call s:X("WildMenu","f0a0c0","302028","","Magenta","")
327 call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
328 call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
329 call s:X("SignColumn","777777","333333","","",s:termBlack)
330 call s:X("ColorColumn","","000000","","",s:termBlack)
332 call s:X("Title","70b950","","bold","Green","")
334 call s:X("Constant","cf6a4c","","","Red","")
335 call s:X("Special","799d6a","","","Green","")
336 call s:X("Delimiter","668799","","","Grey","")
338 call s:X("String","99ad6a","","","Green","")
339 call s:X("StringDelimiter","556633","","","DarkGreen","")
341 call s:X("Identifier","c6b6ee","","","LightCyan","")
342 call s:X("Structure","8fbfdc","","","LightCyan","")
343 call s:X("Function","fad07a","","","Yellow","")
344 call s:X("Statement","8197bf","","","DarkBlue","")
345 call s:X("PreProc","8fbfdc","","","LightBlue","")
347 hi! link Operator Normal
349 call s:X("Type","ffb964","","","Yellow","")
350 call s:X("NonText","606060","151515","",s:termBlack,"")
352 call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
354 call s:X("Search","f0a0c0","302028","underline","Magenta","")
356 call s:X("Directory","dad085","","","Yellow","")
357 call s:X("ErrorMsg","","902020","","","DarkRed")
358 hi! link Error ErrorMsg
359 hi! link MoreMsg Special
360 call s:X("Question","65C254","","","Green","")
365 call s:X("SpellBad","","902020","underline","","DarkRed")
366 call s:X("SpellCap","","0000df","underline","","Blue")
367 call s:X("SpellRare","","540063","underline","","DarkMagenta")
368 call s:X("SpellLocal","","2D7067","underline","","Green")
372 hi! link diffRemoved Constant
373 hi! link diffAdded String
377 call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
378 call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
379 call s:X("DiffChange","","2B5B77","","White","DarkBlue")
380 call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
384 hi! link phpFunctions Function
385 call s:X("StorageClass","c59f6f","","","Red","")
386 hi! link phpSuperglobal Identifier
387 hi! link phpQuoteSingle StringDelimiter
388 hi! link phpQuoteDouble StringDelimiter
389 hi! link phpBoolean Constant
390 hi! link phpNull Constant
391 hi! link phpArrayPair Operator
395 hi! link rubySharpBang Comment
396 call s:X("rubyClass","447799","","","DarkBlue","")
397 call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
398 hi! link rubyConstant Type
399 hi! link rubyFunction Function
401 call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
402 call s:X("rubySymbol","7697d6","","","Blue","")
403 hi! link rubyGlobalVariable rubyInstanceVariable
404 hi! link rubyModule rubyClass
405 call s:X("rubyControl","7597c6","","","Blue","")
407 hi! link rubyString String
408 hi! link rubyStringDelimiter StringDelimiter
409 hi! link rubyInterpolationDelimiter Identifier
411 call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
412 call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
413 call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
415 call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
419 hi! link javaScriptValue Constant
420 hi! link javaScriptRegexpString rubyRegexp
424 hi! link coffeeRegExp javaScriptRegexpString
428 hi! link luaOperator Conditional
432 hi! link cOperator Constant
436 hi! link objcClass Type
437 hi! link cocoaClass objcClass
438 hi! link objcSubclass objcClass
439 hi! link objcSuperclass objcClass
440 hi! link objcDirective rubyClass
441 hi! link objcStatement Constant
442 hi! link cocoaFunction Function
443 hi! link objcMethodName Identifier
444 hi! link objcMethodArg Normal
445 hi! link objcMessageName Identifier
449 call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
450 call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
454 if !exists("g:indent_guides_auto_colors")
455 let g:indent_guides_auto_colors = 0
457 call s:X("IndentGuidesOdd","","202020","","","")
458 call s:X("IndentGuidesEven","","1c1c1c","","","")
462 hi! link TagListFileName Directory
463 call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
465 " Manual overrides for 256-color terminals. Dark colors auto-map badly.
467 hi StatusLineNC ctermbg=235
468 hi Folded ctermbg=236
469 hi FoldColumn ctermbg=234
470 hi SignColumn ctermbg=236
471 hi CursorColumn ctermbg=234
472 hi CursorLine ctermbg=234
473 hi SpecialKey ctermbg=234
474 hi NonText ctermbg=233
475 hi LineNr ctermbg=233
476 hi DiffText ctermfg=81
477 hi Normal ctermbg=233
478 hi DbgBreakPt ctermbg=53
481 " delete functions {{{