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: May 26th, 2009
16 " Contributors: Daniel Herbert <http://pocket-ninja.com>,
17 " Henry So, Jr. <henryso@panix.com>,
18 " David Liang <bmdavll at gmail dot com>
20 " Copyright (c) 2009 NanoTech
22 " Permission is hereby granted, free of charge, to any person obtaining a copy
23 " of this software and associated documentation files (the "Software"), to deal
24 " in the Software without restriction, including without limitation the rights
25 " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26 " copies of the Software, and to permit persons to whom the Software is
27 " furnished to do so, subject to the following conditions:
29 " The above copyright notice and this permission notice shall be included in
30 " all copies or substantial portions of the Software.
32 " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37 " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44 if exists("syntax_on")
48 let colors_name = "jellybeans"
50 if has("gui_running") || &t_Co == 88 || &t_Co == 256
56 " Color approximation functions by Henry So, Jr. and David Liang {{{
57 " Added to jellybeans.vim by Daniel Herbert
59 " returns an approximate grey index for the given grey level
87 let l:n = (a:x - 8) / 10
88 let l:m = (a:x - 8) % 10
98 " returns the actual grey level represented by the grey index
126 return 8 + (a:n * 10)
131 " returns the palette index for the given grey index
152 " returns an approximate color index for the given color level
168 let l:n = (a:x - 55) / 40
169 let l:m = (a:x - 55) % 40
179 " returns the actual color level for the given color index
195 return 55 + (a:n * 40)
200 " returns the palette index for the given R/G/B color indices
201 fun! s:rgb_color(x, y, z)
203 return 16 + (a:x * 16) + (a:y * 4) + a:z
205 return 16 + (a:x * 36) + (a:y * 6) + a:z
209 " returns the palette index to approximate the given R/G/B color levels
210 fun! s:color(r, g, b)
211 " get the closest grey
212 let l:gx = s:grey_number(a:r)
213 let l:gy = s:grey_number(a:g)
214 let l:gz = s:grey_number(a:b)
216 " get the closest color
217 let l:x = s:rgb_number(a:r)
218 let l:y = s:rgb_number(a:g)
219 let l:z = s:rgb_number(a:b)
221 if l:gx == l:gy && l:gy == l:gz
222 " there are two possibilities
223 let l:dgr = s:grey_level(l:gx) - a:r
224 let l:dgg = s:grey_level(l:gy) - a:g
225 let l:dgb = s:grey_level(l:gz) - a:b
226 let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
227 let l:dr = s:rgb_level(l:gx) - a:r
228 let l:dg = s:rgb_level(l:gy) - a:g
229 let l:db = s:rgb_level(l:gz) - a:b
230 let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
233 return s:grey_color(l:gx)
236 return s:rgb_color(l:x, l:y, l:z)
239 " only one possibility
240 return s:rgb_color(l:x, l:y, l:z)
244 " returns the palette index to approximate the 'rrggbb' hex string
246 let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
247 let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
248 let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
249 return s:color(l:r, l:g, l:b)
252 " sets the highlighting for the given group
253 fun! s:X(group, fg, bg, attr, lcfg, lcbg)
255 let l:fge = empty(a:lcfg)
256 let l:bge = empty(a:lcbg)
259 exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg
260 elseif !l:fge && l:bge
261 exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE"
262 elseif l:fge && !l:bge
263 exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg
266 let l:fge = empty(a:fg)
267 let l:bge = empty(a:bg)
270 exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg)
271 elseif !l:fge && l:bge
272 exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)
273 elseif l:fge && !l:bge
274 exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermbg=".s:rgb(a:bg)
279 exec "hi ".a:group." gui=none cterm=none"
281 if a:attr == 'italic'
282 exec "hi ".a:group." gui=".a:attr." cterm=none"
284 exec "hi ".a:group." gui=".a:attr." cterm=".a:attr
291 call s:X("CursorLine","","1c1c1c","","","")
292 call s:X("CursorColumn","","1c1c1c","","","")
293 call s:X("MatchParen","ffffff","80a090","bold","","")
295 call s:X("TabLine","000000","b0b8c0","italic","","Black")
296 call s:X("TabLineFill","9098a0","","","","")
297 call s:X("TabLineSel","000000","f0f0f0","italic,bold","","")
300 call s:X("Pmenu","ffffff","000000","","","")
301 call s:X("PmenuSel","101010","eeeeee","","","")
304 call s:X("Visual","","404040","","","")
305 call s:X("Cursor","","b0d0f0","","","")
307 call s:X("Normal","e8e8d3","151515","","White","")
308 call s:X("LineNr","605958","151515","none","Black","")
309 call s:X("Comment","888888","","italic","Grey","")
310 call s:X("Todo","808080","","bold","","")
312 call s:X("StatusLine","f0f0f0","101010","italic","","")
313 call s:X("StatusLineNC","a0a0a0","181818","italic","","")
314 call s:X("VertSplit","181818","181818","italic","","")
316 call s:X("Folded","a0a8b0","384048","italic","black","")
317 call s:X("FoldColumn","a0a8b0","384048","","","")
318 call s:X("SignColumn","a0a8b0","384048","","","")
320 call s:X("Title","70b950","","bold","","")
322 call s:X("Constant","cf6a4c","","","Red","")
323 call s:X("Special","799d6a","","","Green","")
324 call s:X("Delimiter","668799","","","Grey","")
326 call s:X("String","99ad6a","","","Green","")
327 call s:X("StringDelimiter","556633","","","DarkGreen","")
329 call s:X("Identifier","c6b6ee","","","LightCyan","")
330 call s:X("Structure","8fbfdc","","","LightCyan","")
331 call s:X("Function","fad07a","","","Yellow","")
332 call s:X("Statement","8197bf","","","DarkBlue","")
333 call s:X("PreProc","8fbfdc","","","LightBlue","")
335 hi link Operator Normal
337 call s:X("Type","ffb964","","","Yellow","")
338 call s:X("NonText","808080","151515","","","")
340 call s:X("SpecialKey","808080","343434","","","")
342 call s:X("Search","f0a0c0","302028","underline","Magenta","")
344 call s:X("Directory","dad085","","","","")
345 call s:X("ErrorMsg","","902020","","","")
346 hi link Error ErrorMsg
350 hi link diffRemoved Constant
351 hi link diffAdded String
355 call s:X("DiffAdd","","032218","","Black","DarkGreen")
356 call s:X("DiffChange","","100920","","Black","DarkMagenta")
357 call s:X("DiffDelete","220000","220000","","DarkRed","DarkRed")
358 call s:X("DiffText","","000940","","","DarkRed")
362 hi link phpFunctions Function
363 call s:X("StorageClass","c59f6f","","","Red","")
364 hi link phpSuperglobal Identifier
365 hi link phpQuoteSingle StringDelimiter
366 hi link phpQuoteDouble StringDelimiter
367 hi link phpBoolean Constant
368 hi link phpNull Constant
369 hi link phpArrayPair Operator
373 hi link rubySharpBang Comment
374 call s:X("rubyClass","447799","","","DarkBlue","")
375 call s:X("rubyIdentifier","c6b6fe","","","","")
377 call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
378 call s:X("rubySymbol","7697d6","","","Blue","")
379 hi link rubyGlobalVariable rubyInstanceVariable
380 hi link rubyModule rubyClass
381 call s:X("rubyControl","7597c6","","","","")
383 hi link rubyString String
384 hi link rubyStringDelimiter StringDelimiter
385 hi link rubyInterpolationDelimiter Identifier
387 call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
388 call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
389 call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
391 call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
394 hi link javaScriptValue Constant
395 hi link javaScriptRegexpString rubyRegexp
398 hi link TagListFileName Directory
400 " delete functions {{{