Skip to content

Instantly share code, notes, and snippets.

@evilchili
Created August 2, 2011 00:38
Show Gist options
  • Save evilchili/1119342 to your computer and use it in GitHub Desktop.
Save evilchili/1119342 to your computer and use it in GitHub Desktop.
vim colorscheme (xterm)
" Vim color file for xterm-256color
"
" Name: chili.vim
" Maintainer: Greg Boyington <[email protected]>
"
" Adapted from:
" Name: inkpot.vim
" Maintainer: Ciaran McCreesh <[email protected]>
" Homepage: http://github.com/ciaranm/inkpot/
"
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "chili"
" map a urxvt cube number to an xterm-256 cube number
fun! <SID>M(a)
return strpart("0135", a:a, 1) + 0
endfun
" map a urxvt colour to an xterm-256 colour
fun! <SID>X(a)
if &t_Co == 88
return a:a
else
if a:a == 8
return 237
elseif a:a < 16
return a:a
elseif a:a > 79
return 232 + (3 * (a:a - 80))
else
let l:b = a:a - 16
let l:x = l:b % 4
let l:y = (l:b / 4) % 4
let l:z = (l:b / 16)
return 16 + <SID>M(l:x) + (6 * <SID>M(l:y)) + (36 * <SID>M(l:z))
endif
endif
endfun
exec "hi Normal cterm=NONE ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(16)
exec "hi IncSearch cterm=BOLD ctermfg=" . <SID>X(80) . " ctermbg=" . <SID>X(73)
exec "hi Search cterm=NONE ctermfg=" . <SID>X(80) . " ctermbg=" . <SID>X(52)
exec "hi ErrorMsg cterm=BOLD ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(48)
exec "hi WarningMsg cterm=BOLD ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(68)
exec "hi ModeMsg cterm=BOLD ctermfg=" . <SID>X(38) . " ctermbg=" . "NONE"
exec "hi MoreMsg cterm=BOLD ctermfg=" . <SID>X(38) . " ctermbg=" . "NONE"
exec "hi Question cterm=BOLD ctermfg=" . <SID>X(52) . " ctermbg=" . "NONE"
exec "hi StatusLine cterm=NONE ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(81)
exec "hi User1 cterm=NONE ctermfg=" . <SID>X(28) . " ctermbg=" . <SID>X(81)
exec "hi User2 cterm=NONE ctermfg=" . <SID>X(39) . " ctermbg=" . <SID>X(81)
exec "hi StatusLineNC cterm=NONE ctermfg=" . <SID>X(84) . " ctermbg=" . <SID>X(81)
exec "hi VertSplit cterm=NONE ctermfg=" . <SID>X(84) . " ctermbg=" . <SID>X(81)
exec "hi WildMenu cterm=BOLD ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(38)
exec "hi MBENormal ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(81)
exec "hi MBEChanged ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(81)
exec "hi MBEVisibleNormal ctermfg=" . <SID>X(85) . " ctermbg=" . <SID>X(82)
exec "hi MBEVisibleChanged ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(82)
exec "hi DiffText cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(34)
exec "hi DiffChange cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(17)
exec "hi DiffDelete cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(32)
exec "hi DiffAdd cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(20)
exec "hi Folded cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(35)
exec "hi FoldColumn cterm=NONE ctermfg=" . <SID>X(39) . " ctermbg=" . <SID>X(80)
exec "hi Directory cterm=NONE ctermfg=" . <SID>X(28) . " ctermbg=" . "NONE"
exec "hi LineNr cterm=NONE ctermfg=" . <SID>X(81) . " ctermbg=" . "NONE"
exec "hi NonText cterm=BOLD ctermfg=" . <SID>X(39) . " ctermbg=" . "NONE"
exec "hi SpecialKey cterm=BOLD ctermfg=" . <SID>X(55) . " ctermbg=" . "NONE"
exec "hi Title cterm=BOLD ctermfg=" . <SID>X(48) . " ctermbg=" . "NONE"
exec "hi Visual cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(38)
exec "hi Comment cterm=NONE ctermfg=" . <SID>X(221) . " ctermbg=" . "NONE"
exec "hi Constant cterm=NONE ctermfg=" . <SID>X(73) . " ctermbg=" . "NONE"
exec "hi String cterm=NONE ctermfg=" . <SID>X(38) . " ctermbg=" . "NONE"
exec "hi Error cterm=NONE ctermfg=" . <SID>X(79) . " ctermbg=" . <SID>X(32)
exec "hi Identifier cterm=NONE ctermfg=" . <SID>X(53) . " ctermbg=" . "NONE"
exec "hi Ignore cterm=NONE"
exec "hi Number cterm=NONE ctermfg=" . <SID>X(69) . " ctermbg=" . "NONE"
exec "hi PreProc cterm=NONE ctermfg=" . <SID>X(25) . " ctermbg=" . "NONE"
exec "hi Special cterm=NONE ctermfg=" . <SID>X(55) . " ctermbg=" . "NONE"
exec "hi SpecialChar cterm=NONE ctermfg=" . <SID>X(55) . " ctermbg=" . <SID>X(81)
exec "hi Statement cterm=NONE ctermfg=" . <SID>X(27) . " ctermbg=" . "NONE"
exec "hi Todo cterm=BOLD ctermfg=" . <SID>X(16) . " ctermbg=" . <SID>X(57)
exec "hi Type cterm=NONE ctermfg=" . <SID>X(71) . " ctermbg=" . "NONE"
exec "hi Underlined cterm=BOLD ctermfg=" . <SID>X(77) . " ctermbg=" . "NONE"
exec "hi TaglistTagName cterm=BOLD ctermfg=" . <SID>X(39) . " ctermbg=" . "NONE"
if v:version >= 700
exec "hi Pmenu cterm=NONE ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(82)
exec "hi PmenuSel cterm=BOLD ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(38)
exec "hi PmenuSbar cterm=BOLD ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(39)
exec "hi PmenuThumb cterm=BOLD ctermfg=" . <SID>X(87) . " ctermbg=" . <SID>X(39)
exec "hi SpellBad cterm=NONE ctermbg=" . <SID>X(32)
exec "hi SpellRare cterm=NONE ctermbg=" . <SID>X(33)
exec "hi SpellLocal cterm=NONE ctermbg=" . <SID>X(36)
exec "hi SpellCap cterm=NONE ctermbg=" . <SID>X(21)
exec "hi MatchParen cterm=NONE ctermbg=" . <SID>X(14) . "ctermfg=" . <SID>X(25)
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment