├── .gitignore ├── ansi-term-colors.txt ├── README.markdown └── colors └── jellybeans.vim /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | *.swp 4 | -------------------------------------------------------------------------------- /ansi-term-colors.txt: -------------------------------------------------------------------------------- 1 | Black rgb(59,59,59) #3b3b3b 2 | Red rgb(207,106,76) #cf6a4c 3 | Green rgb(153,173,106) #99ad6a 4 | Yellow rgb(216,173,76) #d8ad4c 5 | Blue rgb(89,123,197) #597bc5 6 | Magenta rgb(160,55,176) #a037b0 7 | Cyan rgb(113,185,248) #71b9f8 8 | White rgb(173,173,173) #adadad 9 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | jellybeans.vim 2 | ============== 3 | 4 | A colorful, dark color scheme, inspired by [ir_black][] and [twilight][]. 5 | 6 | Designed primarily for a graphical Vim, but includes support for 256, 88, 16, 7 | and 8 color terminals. On a 16 or 8 color terminal, replace its colors with 8 | those in `ansi-term-colors.txt` for best results. 9 | 10 | This script is [vimscript #2555][vimscript] at Vim.org. 11 | 12 | Scroll down for [screenshots][ss-anchor]! 13 | 14 | ## Options 15 | 16 | ### Custom Highlights 17 | 18 | If you prefer slightly different colors from what Jellybeans defines, 19 | you can set `g:jellybeans_overrides` in your .vimrc to a dictionary of 20 | custom highlighting parameters: 21 | 22 | let g:jellybeans_overrides = { 23 | \ 'Todo': { 'guifg': '303030', 'guibg': 'f0f000', 24 | \ 'ctermfg': 'Black', 'ctermbg': 'Yellow', 25 | \ 'attr': 'bold' }, 26 | \ 'Comment': { 'guifg': 'cccccc' }, 27 | \} 28 | 29 | This removes the need to edit Jellybeans directly, simplifying 30 | upgrades. In addition, RGB colors specified this way are run through 31 | the same color approximation algorithm that the core theme uses, so 32 | your colors work just as well in 256-color terminals. 33 | 34 | If you can pick better colors than the approximator, specify them 35 | in the `256ctermfg` and `256ctermbg` parameters to override 36 | its choices. 37 | 38 | #### Custom Background Colors 39 | 40 | To set a custom background color, override the special 41 | `background` highlight group: 42 | 43 | let g:jellybeans_overrides = { 44 | \ 'background': { 'guibg': '000000' }, 45 | \} 46 | 47 | Jellybeans uses the background color in multiple highlight 48 | groups. Using the special `background` group overrides them all 49 | at once. 50 | 51 | This replaces `g:jellybeans_background_color` and 52 | `g:jellybeans_background_color_256` from Jellybeans versions 53 | before 1.6. 54 | 55 | #### Terminal Background 56 | 57 | If you would prefer to use your terminal's default background 58 | (e.g. for transparent backgrounds, image backgrounds, or a 59 | different color) instead of the background color that Jellybeans 60 | applies, use this `background` override: 61 | 62 | let g:jellybeans_overrides = { 63 | \ 'background': { 'ctermbg': 'none', '256ctermbg': 'none' }, 64 | \} 65 | 66 | ### Italics 67 | 68 | Jellybeans disables italics in terminal Vim by default, as some 69 | terminals do other things with the text's colors instead of 70 | actually italicizing the text. If your terminal does fully 71 | support italics, add 72 | 73 | let g:jellybeans_use_term_italics = 1 74 | 75 | to your .vimrc to enable italics in terminal Vim. 76 | 77 | If you don't want italics even in GUI Vim, add 78 | 79 | let g:jellybeans_use_gui_italics = 0 80 | 81 | ### Low-Color Black (16 and 8 color terminals) 82 | 83 | Since the background on a dark terminal is usually black already, 84 | Jellybeans appropriates the black ANSI color as a dark grey and 85 | uses no color when it really wants black. 86 | 87 | If you can’t or don’t want to change your terminal’s color 88 | mappings, add 89 | 90 | let g:jellybeans_use_lowcolor_black = 0 91 | 92 | to your .vimrc to render “black” text as Vim’s grey (ANSI white). 93 | 94 | Users of Apple’s pre-10.7 Terminal.app can use the TerminalColours 95 | plugin ([Leopard][tc-leopard], [Snow Leopard][tc-snowleopard]) to 96 | change the default colors. 97 | 98 | ## Screenshots 99 | 100 | ![][preview-ss] 101 | 102 | The font in the screenshot is 10pt [Monaco][monaco]: 103 | 104 | ```vim 105 | set guifont=Monaco:h10 noanti 106 | ``` 107 | 108 | 109 | [ir_black]: https://web.archive.org/web/20140211124943/http://toddwerth.com/2008/01/25/a-black-os-x-leopard-terminal-theme-that-is-actually-readable/ 110 | [twilight]: http://www.vim.org/scripts/script.php?script_id=1677 111 | [vimscript]: http://www.vim.org/scripts/script.php?script_id=2555 112 | [tc-leopard]: http://ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal 113 | [tc-snowleopard]: https://github.com/timmfin/terminalcolours 114 | [preview-ss]: https://nanotech.nanotechcorp.net/downloads/jellybeans-preview.png 115 | [ss-anchor]: #screenshots 116 | [monaco]: https://en.wikipedia.org/wiki/Monaco_(typeface) 117 | -------------------------------------------------------------------------------- /colors/jellybeans.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " 3 | " " __ _ _ _ " 4 | " " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " 5 | " " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " 6 | " " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " 7 | " " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " 8 | " " \___/ " 9 | " 10 | " "A colorful, dark color scheme for Vim." 11 | " 12 | " File: jellybeans.vim 13 | " URL: github.com/nanotech/jellybeans.vim 14 | " Scripts URL: vim.org/scripts/script.php?script_id=2555 15 | " Maintainer: NanoTech (nanotech.nanotechcorp.net) 16 | " Version: 1.6 17 | " Last Change: October 18th, 2016 18 | " License: MIT 19 | " Contributors: Andrew Wong (w0ng) 20 | " Brian Marshall (bmars) 21 | " Daniel Herbert (pocketninja) 22 | " David Liang 23 | " Henry So, Jr. 24 | " Joe Doherty (docapotamus) 25 | " Karl Litterfeldt (Litterfeldt) 26 | " Keith Pitt (keithpitt) 27 | " Philipp Rustemeier (12foo) 28 | " Rafael Bicalho (rbika) 29 | " Rich Healey (richo) 30 | " Siwen Yu (yusiwen) 31 | " Tim Willis (willist) 32 | " 33 | " Copyright (c) 2009-2016 NanoTech 34 | " 35 | " Permission is hereby granted, free of charge, to any per‐ 36 | " son obtaining a copy of this software and associated doc‐ 37 | " umentation files (the “Software”), to deal in the Soft‐ 38 | " ware without restriction, including without limitation 39 | " the rights to use, copy, modify, merge, publish, distrib‐ 40 | " ute, sublicense, and/or sell copies of the Software, and 41 | " to permit persons to whom the Software is furnished to do 42 | " so, subject to the following conditions: 43 | " 44 | " The above copyright notice and this permission notice 45 | " shall be included in all copies or substantial portions 46 | " of the Software. 47 | " 48 | " THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY 49 | " KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 50 | " THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐ 51 | " LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 52 | " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 53 | " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐ 54 | " TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ 55 | " NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 56 | " THE SOFTWARE. 57 | 58 | set background=dark 59 | 60 | hi clear 61 | 62 | if exists("syntax_on") 63 | syntax reset 64 | endif 65 | 66 | let colors_name = "jellybeans" 67 | 68 | if has("gui_running") || (has('termguicolors') && &termguicolors) || &t_Co >= 88 69 | let s:low_color = 0 70 | else 71 | let s:low_color = 1 72 | endif 73 | 74 | " Configuration Variables: 75 | " - g:jellybeans_overrides (default = {}) 76 | " - g:jellybeans_use_lowcolor_black (default = 1) 77 | " - g:jellybeans_use_gui_italics (default = 1) 78 | " - g:jellybeans_use_term_italics (default = 0) 79 | 80 | let s:background_color = "151515" 81 | 82 | if exists("g:jellybeans_overrides") 83 | let s:overrides = g:jellybeans_overrides 84 | else 85 | let s:overrides = {} 86 | endif 87 | 88 | " Backwards compatibility 89 | if exists("g:jellybeans_background_color") 90 | \ || exists("g:jellybeans_background_color_256") 91 | \ || exists("g:jellybeans_use_term_background_color") 92 | 93 | let s:overrides = deepcopy(s:overrides) 94 | 95 | if !has_key(s:overrides, "background") 96 | let s:overrides["background"] = {} 97 | endif 98 | 99 | if exists("g:jellybeans_background_color") 100 | let s:overrides["background"]["guibg"] = g:jellybeans_background_color 101 | endif 102 | 103 | if exists("g:jellybeans_background_color_256") 104 | let s:overrides["background"]["256ctermbg"] = g:jellybeans_background_color_256 105 | endif 106 | 107 | if exists("g:jellybeans_use_term_background_color") 108 | \ && g:jellybeans_use_term_background_color 109 | let s:overrides["background"]["ctermbg"] = "NONE" 110 | let s:overrides["background"]["256ctermbg"] = "NONE" 111 | endif 112 | endif 113 | 114 | if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black 115 | let s:termBlack = "Black" 116 | else 117 | let s:termBlack = "Grey" 118 | endif 119 | 120 | " When `termguicolors` is set, Vim[^1] ignores `guibg=NONE` after 121 | " `guibg` is already set to a color. See: 122 | " 123 | " - https://github.com/vim/vim/issues/981 124 | " - https://github.com/nanotech/jellybeans.vim/issues/64 125 | " 126 | " To work around this, ensure we don't set the default background 127 | " color before an override changes it to `NONE` by ensuring that the 128 | " background color isn't set to a value different from its override. 129 | " 130 | " [^1]: Tested on 8.0.567. Does not apply to Neovim. 131 | " 132 | " TODO: Enable this behavior for all highlights by applying 133 | " overrides before calling highlight commands. 134 | " 135 | if has_key(s:overrides, "background") && has_key(s:overrides["background"], "guibg") 136 | let s:background_color = s:overrides["background"]["guibg"] 137 | endif 138 | 139 | " Color approximation functions by Henry So, Jr. and David Liang {{{ 140 | " Added to jellybeans.vim by Daniel Herbert 141 | 142 | " returns an approximate grey index for the given grey level 143 | fun! s:grey_number(x) 144 | if &t_Co == 88 145 | if a:x < 23 146 | return 0 147 | elseif a:x < 69 148 | return 1 149 | elseif a:x < 103 150 | return 2 151 | elseif a:x < 127 152 | return 3 153 | elseif a:x < 150 154 | return 4 155 | elseif a:x < 173 156 | return 5 157 | elseif a:x < 196 158 | return 6 159 | elseif a:x < 219 160 | return 7 161 | elseif a:x < 243 162 | return 8 163 | else 164 | return 9 165 | endif 166 | else 167 | if a:x < 14 168 | return 0 169 | else 170 | let l:n = (a:x - 8) / 10 171 | let l:m = (a:x - 8) % 10 172 | if l:m < 5 173 | return l:n 174 | else 175 | return l:n + 1 176 | endif 177 | endif 178 | endif 179 | endfun 180 | 181 | " returns the actual grey level represented by the grey index 182 | fun! s:grey_level(n) 183 | if &t_Co == 88 184 | if a:n == 0 185 | return 0 186 | elseif a:n == 1 187 | return 46 188 | elseif a:n == 2 189 | return 92 190 | elseif a:n == 3 191 | return 115 192 | elseif a:n == 4 193 | return 139 194 | elseif a:n == 5 195 | return 162 196 | elseif a:n == 6 197 | return 185 198 | elseif a:n == 7 199 | return 208 200 | elseif a:n == 8 201 | return 231 202 | else 203 | return 255 204 | endif 205 | else 206 | if a:n == 0 207 | return 0 208 | else 209 | return 8 + (a:n * 10) 210 | endif 211 | endif 212 | endfun 213 | 214 | " returns the palette index for the given grey index 215 | fun! s:grey_color(n) 216 | if &t_Co == 88 217 | if a:n == 0 218 | return 16 219 | elseif a:n == 9 220 | return 79 221 | else 222 | return 79 + a:n 223 | endif 224 | else 225 | if a:n == 0 226 | return 16 227 | elseif a:n == 25 228 | return 231 229 | else 230 | return 231 + a:n 231 | endif 232 | endif 233 | endfun 234 | 235 | " returns an approximate color index for the given color level 236 | fun! s:rgb_number(x) 237 | if &t_Co == 88 238 | if a:x < 69 239 | return 0 240 | elseif a:x < 172 241 | return 1 242 | elseif a:x < 230 243 | return 2 244 | else 245 | return 3 246 | endif 247 | else 248 | if a:x < 75 249 | return 0 250 | else 251 | let l:n = (a:x - 55) / 40 252 | let l:m = (a:x - 55) % 40 253 | if l:m < 20 254 | return l:n 255 | else 256 | return l:n + 1 257 | endif 258 | endif 259 | endif 260 | endfun 261 | 262 | " returns the actual color level for the given color index 263 | fun! s:rgb_level(n) 264 | if &t_Co == 88 265 | if a:n == 0 266 | return 0 267 | elseif a:n == 1 268 | return 139 269 | elseif a:n == 2 270 | return 205 271 | else 272 | return 255 273 | endif 274 | else 275 | if a:n == 0 276 | return 0 277 | else 278 | return 55 + (a:n * 40) 279 | endif 280 | endif 281 | endfun 282 | 283 | " returns the palette index for the given R/G/B color indices 284 | fun! s:rgb_color(x, y, z) 285 | if &t_Co == 88 286 | return 16 + (a:x * 16) + (a:y * 4) + a:z 287 | else 288 | return 16 + (a:x * 36) + (a:y * 6) + a:z 289 | endif 290 | endfun 291 | 292 | " returns the palette index to approximate the given R/G/B color levels 293 | fun! s:color(r, g, b) 294 | " map greys directly (see xterm's 256colres.pl) 295 | if &t_Co == 256 && a:r == a:g && a:g == a:b && a:r > 3 && a:r < 243 296 | return (a:r - 8) / 10 + 232 297 | endif 298 | 299 | " get the closest grey 300 | let l:gx = s:grey_number(a:r) 301 | let l:gy = s:grey_number(a:g) 302 | let l:gz = s:grey_number(a:b) 303 | 304 | " get the closest color 305 | let l:x = s:rgb_number(a:r) 306 | let l:y = s:rgb_number(a:g) 307 | let l:z = s:rgb_number(a:b) 308 | 309 | if l:gx == l:gy && l:gy == l:gz 310 | " there are two possibilities 311 | let l:dgr = s:grey_level(l:gx) - a:r 312 | let l:dgg = s:grey_level(l:gy) - a:g 313 | let l:dgb = s:grey_level(l:gz) - a:b 314 | let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) 315 | let l:dr = s:rgb_level(l:gx) - a:r 316 | let l:dg = s:rgb_level(l:gy) - a:g 317 | let l:db = s:rgb_level(l:gz) - a:b 318 | let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) 319 | if l:dgrey < l:drgb 320 | " use the grey 321 | return s:grey_color(l:gx) 322 | else 323 | " use the color 324 | return s:rgb_color(l:x, l:y, l:z) 325 | endif 326 | else 327 | " only one possibility 328 | return s:rgb_color(l:x, l:y, l:z) 329 | endif 330 | endfun 331 | 332 | fun! s:is_empty_or_none(str) 333 | return empty(a:str) || a:str ==? "NONE" 334 | endfun 335 | 336 | " returns the palette index to approximate the 'rrggbb' hex string 337 | fun! s:rgb(rgb) 338 | if s:is_empty_or_none(a:rgb) 339 | return "NONE" 340 | endif 341 | let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 342 | let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 343 | let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 344 | return s:color(l:r, l:g, l:b) 345 | endfun 346 | 347 | fun! s:prefix_highlight_value_with(prefix, color) 348 | if s:is_empty_or_none(a:color) 349 | return "NONE" 350 | else 351 | return a:prefix . a:color 352 | endif 353 | endfun 354 | 355 | fun! s:remove_italic_attr(attr) 356 | let l:attr = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",") 357 | if empty(l:attr) 358 | let l:attr = "NONE" 359 | endif 360 | return l:attr 361 | endfun 362 | 363 | " sets the highlighting for the given group 364 | fun! s:X(group, fg, bg, attr, lcfg, lcbg) 365 | if s:low_color 366 | exec "hi ".a:group. 367 | \ " ctermfg=".s:prefix_highlight_value_with("", a:lcfg). 368 | \ " ctermbg=".s:prefix_highlight_value_with("", a:lcbg) 369 | else 370 | exec "hi ".a:group. 371 | \ " guifg=".s:prefix_highlight_value_with("#", a:fg). 372 | \ " guibg=".s:prefix_highlight_value_with("#", a:bg). 373 | \ " ctermfg=".s:rgb(a:fg). 374 | \ " ctermbg=".s:rgb(a:bg) 375 | endif 376 | 377 | let l:attr = s:prefix_highlight_value_with("", a:attr) 378 | 379 | if exists("g:jellybeans_use_term_italics") && g:jellybeans_use_term_italics 380 | let l:cterm_attr = l:attr 381 | else 382 | let l:cterm_attr = s:remove_italic_attr(l:attr) 383 | endif 384 | 385 | if !exists("g:jellybeans_use_gui_italics") || g:jellybeans_use_gui_italics 386 | let l:gui_attr = l:attr 387 | else 388 | let l:gui_attr = s:remove_italic_attr(l:attr) 389 | endif 390 | 391 | exec "hi ".a:group." gui=".l:gui_attr." cterm=".l:cterm_attr 392 | endfun 393 | " }}} 394 | 395 | call s:X("Normal","e8e8d3",s:background_color,"","White","") 396 | set background=dark 397 | 398 | if version >= 700 399 | call s:X("CursorLine","","1c1c1c","","",s:termBlack) 400 | call s:X("CursorColumn","","1c1c1c","","",s:termBlack) 401 | call s:X("MatchParen","ffffff","556779","bold","","DarkCyan") 402 | 403 | call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack) 404 | call s:X("TabLineFill","9098a0","","","",s:termBlack) 405 | call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White") 406 | 407 | " Auto-completion 408 | call s:X("Pmenu","ffffff","606060","","White",s:termBlack) 409 | call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White") 410 | endif 411 | 412 | call s:X("Visual","","404040","","",s:termBlack) 413 | call s:X("Cursor",s:background_color,"b0d0f0","","","") 414 | 415 | call s:X("LineNr","605958",s:background_color,"NONE",s:termBlack,"") 416 | call s:X("CursorLineNr","ccc5c4","","NONE","White","") 417 | call s:X("Comment","888888","","italic","Grey","") 418 | call s:X("Todo","c7c7c7","","bold","White",s:termBlack) 419 | 420 | call s:X("StatusLine","000000","dddddd","italic","","White") 421 | call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") 422 | call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack) 423 | call s:X("WildMenu","f0a0c0","302028","","Magenta","") 424 | 425 | call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"") 426 | call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack) 427 | call s:X("SignColumn","777777","333333","","",s:termBlack) 428 | call s:X("ColorColumn","","000000","","",s:termBlack) 429 | 430 | call s:X("Title","70b950","","bold","Green","") 431 | 432 | call s:X("Constant","cf6a4c","","","Red","") 433 | call s:X("Special","799d6a","","","Green","") 434 | call s:X("Delimiter","668799","","","Grey","") 435 | 436 | call s:X("String","99ad6a","","","Green","") 437 | call s:X("StringDelimiter","556633","","","DarkGreen","") 438 | 439 | call s:X("Identifier","c6b6ee","","","LightCyan","") 440 | call s:X("Structure","8fbfdc","","","LightCyan","") 441 | call s:X("Function","fad07a","","","Yellow","") 442 | call s:X("Statement","8197bf","","","DarkBlue","") 443 | call s:X("PreProc","8fbfdc","","","LightBlue","") 444 | 445 | hi! link Operator Structure 446 | hi! link Conceal Operator 447 | 448 | call s:X("Type","ffb964","","","Yellow","") 449 | call s:X("NonText","606060",s:background_color,"",s:termBlack,"") 450 | 451 | call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"") 452 | 453 | call s:X("Search","f0a0c0","302028","","Magenta","") 454 | 455 | call s:X("Directory","dad085","","","Yellow","") 456 | call s:X("ErrorMsg","","902020","","","DarkRed") 457 | hi! link Error ErrorMsg 458 | hi! link MoreMsg Special 459 | call s:X("Question","65C254","","","Green","") 460 | 461 | 462 | " Spell Checking 463 | 464 | call s:X("SpellBad","","902020","","","DarkRed") 465 | call s:X("SpellCap","","0000df","","","Blue") 466 | call s:X("SpellRare","","540063","","","DarkMagenta") 467 | call s:X("SpellLocal","","2D7067","","","Green") 468 | 469 | " Diff 470 | 471 | hi! link diffRemoved Constant 472 | hi! link diffAdded String 473 | 474 | " VimDiff 475 | 476 | call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen") 477 | call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed") 478 | call s:X("DiffChange","","2B5B77","","White","DarkBlue") 479 | call s:X("DiffText","8fbfdc","000000","reverse","Yellow","") 480 | 481 | " PHP 482 | 483 | hi! link phpFunctions Function 484 | call s:X("StorageClass","c59f6f","","","Red","") 485 | hi! link phpSuperglobal Identifier 486 | hi! link phpQuoteSingle StringDelimiter 487 | hi! link phpQuoteDouble StringDelimiter 488 | hi! link phpBoolean Constant 489 | hi! link phpNull Constant 490 | hi! link phpArrayPair Operator 491 | hi! link phpOperator Normal 492 | hi! link phpRelation Normal 493 | hi! link phpVarSelector Identifier 494 | 495 | " Python 496 | 497 | hi! link pythonOperator Statement 498 | 499 | " Ruby 500 | 501 | hi! link rubySharpBang Comment 502 | call s:X("rubyClass","447799","","","DarkBlue","") 503 | call s:X("rubyIdentifier","c6b6fe","","","Cyan","") 504 | hi! link rubyConstant Type 505 | hi! link rubyFunction Function 506 | 507 | call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") 508 | call s:X("rubySymbol","7697d6","","","Blue","") 509 | hi! link rubyGlobalVariable rubyInstanceVariable 510 | hi! link rubyModule rubyClass 511 | call s:X("rubyControl","7597c6","","","Blue","") 512 | 513 | hi! link rubyString String 514 | hi! link rubyStringDelimiter StringDelimiter 515 | hi! link rubyInterpolationDelimiter Identifier 516 | 517 | call s:X("rubyRegexpDelimiter","540063","","","Magenta","") 518 | call s:X("rubyRegexp","dd0093","","","DarkMagenta","") 519 | call s:X("rubyRegexpSpecial","a40073","","","Magenta","") 520 | 521 | call s:X("rubyPredefinedIdentifier","de5577","","","Red","") 522 | 523 | " Erlang 524 | 525 | hi! link erlangAtom rubySymbol 526 | hi! link erlangBIF rubyPredefinedIdentifier 527 | hi! link erlangFunction rubyPredefinedIdentifier 528 | hi! link erlangDirective Statement 529 | hi! link erlangNode Identifier 530 | 531 | " Elixir 532 | 533 | hi! link elixirAtom rubySymbol 534 | 535 | 536 | " JavaScript 537 | 538 | hi! link javaScriptValue Constant 539 | hi! link javaScriptRegexpString rubyRegexp 540 | hi! link javaScriptTemplateVar StringDelim 541 | hi! link javaScriptTemplateDelim Identifier 542 | hi! link javaScriptTemplateString String 543 | 544 | " CoffeeScript 545 | 546 | hi! link coffeeRegExp javaScriptRegexpString 547 | 548 | " Lua 549 | 550 | hi! link luaOperator Conditional 551 | 552 | " C 553 | 554 | hi! link cFormat Identifier 555 | hi! link cOperator Constant 556 | 557 | " Objective-C/Cocoa 558 | 559 | hi! link objcClass Type 560 | hi! link cocoaClass objcClass 561 | hi! link objcSubclass objcClass 562 | hi! link objcSuperclass objcClass 563 | hi! link objcDirective rubyClass 564 | hi! link objcStatement Constant 565 | hi! link cocoaFunction Function 566 | hi! link objcMethodName Identifier 567 | hi! link objcMethodArg Normal 568 | hi! link objcMessageName Identifier 569 | 570 | " Vimscript 571 | 572 | hi! link vimOper Normal 573 | 574 | " HTML 575 | 576 | hi! link htmlTag Statement 577 | hi! link htmlEndTag htmlTag 578 | hi! link htmlTagName htmlTag 579 | 580 | " XML 581 | 582 | hi! link xmlTag Statement 583 | hi! link xmlEndTag xmlTag 584 | hi! link xmlTagName xmlTag 585 | hi! link xmlEqual xmlTag 586 | hi! link xmlEntity Special 587 | hi! link xmlEntityPunct xmlEntity 588 | hi! link xmlDocTypeDecl PreProc 589 | hi! link xmlDocTypeKeyword PreProc 590 | hi! link xmlProcessingDelim xmlAttrib 591 | 592 | " Debugger.vim 593 | 594 | call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue") 595 | call s:X("DbgBreakPt","","4F0037","","","DarkMagenta") 596 | 597 | " vim-indent-guides 598 | 599 | if !exists("g:indent_guides_auto_colors") 600 | let g:indent_guides_auto_colors = 0 601 | endif 602 | call s:X("IndentGuidesOdd","","232323","","","") 603 | call s:X("IndentGuidesEven","","1b1b1b","","","") 604 | 605 | " Plugins, etc. 606 | 607 | hi! link TagListFileName Directory 608 | call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") 609 | 610 | " Manual overrides for 256-color terminals. Dark colors auto-map badly. 611 | if !s:low_color 612 | hi StatusLineNC ctermbg=235 613 | hi Folded ctermbg=236 614 | hi DiffText ctermfg=81 615 | hi DbgBreakPt ctermbg=53 616 | hi IndentGuidesOdd ctermbg=235 617 | hi IndentGuidesEven ctermbg=234 618 | endif 619 | 620 | if !empty("s:overrides") 621 | fun! s:current_attr(group) 622 | let l:synid = synIDtrans(hlID(a:group)) 623 | let l:attrs = [] 624 | for l:attr in ["bold", "italic", "reverse", "standout", "", "undercurl"] 625 | if synIDattr(l:synid, l:attr, "gui") == 1 626 | call add(l:attrs, l:attr) 627 | endif 628 | endfor 629 | return join(l:attrs, ",") 630 | endfun 631 | fun! s:current_color(group, what, mode) 632 | let l:color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode) 633 | if l:color == -1 634 | return "" 635 | else 636 | return substitute(l:color, "^#", "", "") 637 | endif 638 | endfun 639 | fun! s:load_color_def(group, def) 640 | call s:X(a:group, get(a:def, "guifg", s:current_color(a:group, "fg", "gui")), 641 | \ get(a:def, "guibg", s:current_color(a:group, "bg", "gui")), 642 | \ get(a:def, "attr", s:current_attr(a:group)), 643 | \ get(a:def, "ctermfg", s:current_color(a:group, "fg", "cterm")), 644 | \ get(a:def, "ctermbg", s:current_color(a:group, "bg", "cterm"))) 645 | if !s:low_color 646 | for l:prop in ["ctermfg", "ctermbg"] 647 | let l:override_key = "256".l:prop 648 | if has_key(a:def, l:override_key) 649 | exec "hi ".a:group." ".l:prop."=".a:def[l:override_key] 650 | endif 651 | endfor 652 | endif 653 | endfun 654 | fun! s:load_colors(defs) 655 | for [l:group, l:def] in items(a:defs) 656 | if l:group == "background" 657 | call s:load_color_def("LineNr", l:def) 658 | call s:load_color_def("NonText", l:def) 659 | call s:load_color_def("Normal", l:def) 660 | else 661 | call s:load_color_def(l:group, l:def) 662 | endif 663 | unlet l:group 664 | unlet l:def 665 | endfor 666 | endfun 667 | call s:load_colors(s:overrides) 668 | delf s:load_colors 669 | delf s:load_color_def 670 | delf s:current_color 671 | delf s:current_attr 672 | endif 673 | 674 | " delete functions {{{ 675 | delf s:X 676 | delf s:remove_italic_attr 677 | delf s:prefix_highlight_value_with 678 | delf s:rgb 679 | delf s:is_empty_or_none 680 | delf s:color 681 | delf s:rgb_color 682 | delf s:rgb_level 683 | delf s:rgb_number 684 | delf s:grey_color 685 | delf s:grey_level 686 | delf s:grey_number 687 | " }}} 688 | --------------------------------------------------------------------------------