├── README.md └── colors └── eddie.vim /README.md: -------------------------------------------------------------------------------- 1 | #Eddie.vim 2 | 3 | A dark pastel colorscheme my friend spent too much time on. 4 | 5 | ###Compatibility 6 | 7 | This colorscheme is compatable in GUI and Terminal Vim. It includes some 8 | modified color highlighting for the following filetypes: HTML, CSS, JavaScript, 9 | HAML, SASS, CoffeeScript, Ruby, ZSH, and a couple others. Also includes better 10 | highlighting for diffing between files in Vim. 11 | 12 | ###Screenshots 13 | 14 | 15 | **HTML** 16 | ![HTML](http://f.cl.ly/items/2y1I3j1N0m3p3s1B3X1J/eddie-html.png) 17 | 18 | **CSS** 19 | ![CSS](http://f.cl.ly/items/0Q1O1Z1P3X1R0z0c0j2J/eddie-css.png) 20 | 21 | **JavaScript** 22 | ![JavaScript](http://f.cl.ly/items/2p0u253d2p3g0u1X1a0m/eddie-js.png) 23 | 24 | _font used is [liberation sans mono](https://fedorahosted.org/liberation-fonts/)_ 25 | 26 | ###Installation 27 | 28 | Add the `eddie.vim` file inside the `colors` directory to your existing 29 | colorschemes in `~/.vim/colors/` 30 | 31 | ###Story 32 | 33 | A buddy of mine spent a lot of time on [his Eclipse color 34 | theme](http://www.eclipsecolorthemes.org/?view=theme&id=738) and I was 35 | continually frustrated with most Vim colorschemes so I just ported his but added 36 | some new colors for diffing. 37 | 38 | ###FAQ 39 | 40 | * *My JavaScript doesn't look like that* 41 | 42 | Sometimes I mess around in syntax files. It's [on 43 | Github](https://github.com/mattsa/vim-javascript) but I won't take any 44 | responsibility for things malfunctioning if you decide to use them. 45 | 46 | * *How do I get the highlight group for a word?* 47 | 48 | Add [this command](https://gist.github.com/1544768) to your .vimrc and use it 49 | as `:Syn` for the word under the cursor. 50 | 51 | * *I don't like what you did for \* 52 | 53 | It's super easy to customize. Just look in the `colors/eddie.vim` file for 54 | whatever you don't like (say, CSS highlighting for pseudo-elements would be 55 | under the CSSgroup as `cssPseudoClass`), find it and change the color to another 56 | one defined at the top of the file or add your own. 57 | 58 | Think it's a good change? File a pull request with a screenshot so that people 59 | can give feedback! 60 | -------------------------------------------------------------------------------- /colors/eddie.vim: -------------------------------------------------------------------------------- 1 | " Eddie Colorscheme for 256 and GUI 2 | " Author: Matt Sacks 3 | " 4 | " This is my adaptation of the pastelmod eclipse theme from my co-worker Eddie 5 | " who spent too much time developing these specific colors. 6 | " Hex color conversion functions borrowed from the themes 'Desert256' and 7 | " Chris Kempson's Tomorrow 8 | 9 | " Default GUI Colours 10 | let s:foreground = "E0E2E4" 11 | let s:background = "1F2223" 12 | let s:tabselection = "516775" 13 | let s:selection = "2E3F49" 14 | let s:line = "81969A" 15 | let s:status_line = "202527" 16 | let s:cursorline = "2F393C" 17 | let s:statusline = "4A5A5F" 18 | let s:comment = "7D8C93" 19 | let s:red = "D77481" 20 | let s:diff_red = "542D32" 21 | let s:orange = "CA9C81" 22 | let s:diff_orange = "574133" 23 | let s:task_tag = "A57B61" 24 | let s:yellow = "E8E2B7" 25 | let s:green = "93C79F" 26 | let s:diff_green = "3E5443" 27 | let s:aqua = "8BA4BA" 28 | let s:blue = "678CB1" 29 | let s:dark_blue = "4E778E" 30 | let s:diff_blue = "2E4754" 31 | let s:purple = "A082BD" 32 | let s:window = "616161" 33 | 34 | set background=dark 35 | hi clear 36 | syntax reset 37 | 38 | let g:colors_name = "eddie" 39 | 40 | if has("gui_running") || &t_Co == 88 || &t_Co == 256 41 | " Color Calculations {{{ 42 | " Returns an approximate grey index for the given grey level 43 | fun grey_number(x) 44 | if &t_Co == 88 45 | if a:x < 23 46 | return 0 47 | elseif a:x < 69 48 | return 1 49 | elseif a:x < 103 50 | return 2 51 | elseif a:x < 127 52 | return 3 53 | elseif a:x < 150 54 | return 4 55 | elseif a:x < 173 56 | return 5 57 | elseif a:x < 196 58 | return 6 59 | elseif a:x < 219 60 | return 7 61 | elseif a:x < 243 62 | return 8 63 | else 64 | return 9 65 | endif 66 | else 67 | if a:x < 14 68 | return 0 69 | else 70 | let l:n = (a:x - 8) / 10 71 | let l:m = (a:x - 8) % 10 72 | if l:m < 5 73 | return l:n 74 | else 75 | return l:n + 1 76 | endif 77 | endif 78 | endif 79 | endfun 80 | 81 | " Returns the actual grey level represented by the grey index 82 | fun grey_level(n) 83 | if &t_Co == 88 84 | if a:n == 0 85 | return 0 86 | elseif a:n == 1 87 | return 46 88 | elseif a:n == 2 89 | return 92 90 | elseif a:n == 3 91 | return 115 92 | elseif a:n == 4 93 | return 139 94 | elseif a:n == 5 95 | return 162 96 | elseif a:n == 6 97 | return 185 98 | elseif a:n == 7 99 | return 208 100 | elseif a:n == 8 101 | return 231 102 | else 103 | return 255 104 | endif 105 | else 106 | if a:n == 0 107 | return 0 108 | else 109 | return 8 + (a:n * 10) 110 | endif 111 | endif 112 | endfun 113 | 114 | " Returns the palette index for the given grey index 115 | fun grey_colour(n) 116 | if &t_Co == 88 117 | if a:n == 0 118 | return 16 119 | elseif a:n == 9 120 | return 79 121 | else 122 | return 79 + a:n 123 | endif 124 | else 125 | if a:n == 0 126 | return 16 127 | elseif a:n == 25 128 | return 231 129 | else 130 | return 231 + a:n 131 | endif 132 | endif 133 | endfun 134 | 135 | " Returns an approximate colour index for the given colour level 136 | fun rgb_number(x) 137 | if &t_Co == 88 138 | if a:x < 69 139 | return 0 140 | elseif a:x < 172 141 | return 1 142 | elseif a:x < 230 143 | return 2 144 | else 145 | return 3 146 | endif 147 | else 148 | if a:x < 75 149 | return 0 150 | else 151 | let l:n = (a:x - 55) / 40 152 | let l:m = (a:x - 55) % 40 153 | if l:m < 20 154 | return l:n 155 | else 156 | return l:n + 1 157 | endif 158 | endif 159 | endif 160 | endfun 161 | 162 | " Returns the actual colour level for the given colour index 163 | fun rgb_level(n) 164 | if &t_Co == 88 165 | if a:n == 0 166 | return 0 167 | elseif a:n == 1 168 | return 139 169 | elseif a:n == 2 170 | return 205 171 | else 172 | return 255 173 | endif 174 | else 175 | if a:n == 0 176 | return 0 177 | else 178 | return 55 + (a:n * 40) 179 | endif 180 | endif 181 | endfun 182 | 183 | " Returns the palette index for the given R/G/B colour indices 184 | fun rgb_colour(x, y, z) 185 | if &t_Co == 88 186 | return 16 + (a:x * 16) + (a:y * 4) + a:z 187 | else 188 | return 16 + (a:x * 36) + (a:y * 6) + a:z 189 | endif 190 | endfun 191 | 192 | " Returns the palette index to approximate the given R/G/B colour levels 193 | fun colour(r, g, b) 194 | " Get the closest grey 195 | let l:gx = grey_number(a:r) 196 | let l:gy = grey_number(a:g) 197 | let l:gz = grey_number(a:b) 198 | 199 | " Get the closest colour 200 | let l:x = rgb_number(a:r) 201 | let l:y = rgb_number(a:g) 202 | let l:z = rgb_number(a:b) 203 | 204 | if l:gx == l:gy && l:gy == l:gz 205 | " There are two possibilities 206 | let l:dgr = grey_level(l:gx) - a:r 207 | let l:dgg = grey_level(l:gy) - a:g 208 | let l:dgb = grey_level(l:gz) - a:b 209 | let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) 210 | let l:dr = rgb_level(l:gx) - a:r 211 | let l:dg = rgb_level(l:gy) - a:g 212 | let l:db = rgb_level(l:gz) - a:b 213 | let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) 214 | if l:dgrey < l:drgb 215 | " Use the grey 216 | return grey_colour(l:gx) 217 | else 218 | " Use the colour 219 | return rgb_colour(l:x, l:y, l:z) 220 | endif 221 | else 222 | " Only one possibility 223 | return rgb_colour(l:x, l:y, l:z) 224 | endif 225 | endfun 226 | 227 | " Returns the palette index to approximate the 'rrggbb' hex string 228 | fun rgb(rgb) 229 | let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 230 | let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 231 | let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 232 | 233 | return colour(l:r, l:g, l:b) 234 | endfun 235 | 236 | " END Color Calculations }}} 237 | 238 | " Sets the highlighting for the given group 239 | fun X(group, fg, bg, attr) 240 | if a:fg != "" 241 | if !has("gui_running") && a:fg == s:green 242 | exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=151" 243 | elseif !has("gui_running") && a:fg == s:green 244 | exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=140" 245 | elseif !has("gui_running") && a:fg == s:aqua 246 | exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=110" 247 | else 248 | exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) 249 | endif 250 | endif 251 | if a:bg != "" 252 | exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) 253 | endif 254 | if a:attr != "" 255 | exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr 256 | endif 257 | endfun 258 | 259 | " Vim Highlighting 260 | call X("Normal", s:foreground, s:background, "") 261 | call X("LineNr", s:line, "", "") 262 | call X("NonText", s:selection, "", "") 263 | call X("SpecialKey", s:selection, "", "") 264 | call X("Search", "", s:yellow, "") 265 | call X("TabLine", s:foreground, s:background, "underline") 266 | call X("TabLineSel", s:foreground, s:tabselection, "none") 267 | call X("TabLineFill", s:foreground, s:background, "underline") 268 | call X("StatusLine", s:statusline, s:foreground, "reverse") 269 | call X("StatusLineNC", s:cursorline, s:comment, "") 270 | call X("VertSplit", s:window, s:window, "none") 271 | call X("Visual", "", s:selection, "none") 272 | call X("Directory", s:blue, "", "") 273 | call X("ModeMsg", s:green, "", "") 274 | call X("MoreMsg", s:green, "", "") 275 | call X("Question", s:green, "", "") 276 | call X("WarningMsg", s:red, "", "") 277 | call X("MatchParen", "", s:selection, "") 278 | call X("Folded", s:comment, s:background, "") 279 | call X("FoldColumn", "", s:background, "") 280 | call X("WildMenu", s:background, s:foreground, "") 281 | if version >= 700 282 | call X("CursorLine", "", s:cursorline, "none") 283 | call X("Cursor", "", s:line, "none") 284 | call X("CursorColumn", "", s:line, "none") 285 | call X("PMenu", s:foreground, s:selection, "none") 286 | call X("PMenuSel", s:foreground, s:selection, "reverse") 287 | end 288 | if version >= 703 289 | call X("ColorColumn", "", s:line, "none") 290 | end 291 | 292 | " Standard Highlighting 293 | call X("Comment", s:comment, "", "") 294 | call X("Todo", s:comment, s:background, "") 295 | call X("Title", s:comment, "", "") 296 | call X("Identifier", s:red, "", "none") 297 | call X("Statement", s:foreground, "", "") 298 | call X("Conditional", s:foreground, "", "") 299 | call X("Repeat", s:foreground, "", "") 300 | call X("Structure", s:purple, "", "") 301 | call X("Function", s:blue, "", "") 302 | call X("Constant", s:orange, "", "") 303 | call X("String", s:green, "", "") 304 | call X("Special", s:foreground, "", "") 305 | call X("PreProc", s:purple, "", "") 306 | call X("Operator", s:aqua, "", "none") 307 | call X("Type", s:blue, "", "none") 308 | call X("Define", s:purple, "", "none") 309 | call X("Include", s:blue, "", "") 310 | "call X("Ignore", "666666", "", "") 311 | 312 | " Vim Highlighting 313 | call X("vimCommand", s:red, "", "none") 314 | 315 | " C Highlighting 316 | call X("cType", s:yellow, "", "") 317 | call X("cStorageClass", s:purple, "", "") 318 | call X("cConditional", s:purple, "", "") 319 | call X("cRepeat", s:purple, "", "") 320 | 321 | " PHP Highlighting 322 | call X("phpVarSelector", s:red, "", "") 323 | call X("phpKeyword", s:purple, "", "") 324 | call X("phpRepeat", s:purple, "", "") 325 | call X("phpConditional", s:purple, "", "") 326 | call X("phpStatement", s:purple, "", "") 327 | call X("phpMemberSelector", s:foreground, "", "") 328 | 329 | " Ruby Highlighting 330 | call X("rubySymbol", s:task_tag, "", "") 331 | call X("rubyConstant", s:yellow, "", "") 332 | call X("rubyAttribute", s:blue, "", "") 333 | call X("rubyInclude", s:blue, "", "") 334 | call X("rubyStringDelimiter", s:green, "", "") 335 | call X("rubyInterpolationDelimiter", s:orange, "", "") 336 | call X("rubyConditional", s:purple, "", "") 337 | call X("rubyRepeat", s:purple, "", "") 338 | call X("rubyClass", s:aqua, "", "") 339 | call X("rubyControl", s:dark_blue, "", "") 340 | 341 | " Python Highlighting 342 | call X("pythonInclude", s:purple, "", "") 343 | call X("pythonStatement", s:purple, "", "") 344 | call X("pythonConditional", s:purple, "", "") 345 | call X("pythonFunction", s:blue, "", "") 346 | 347 | " HTML Highlighting 348 | call X("htmlTag", s:aqua, "", "") 349 | call X("htmlTagName", s:aqua, "", "") 350 | call X("htmlSpecialTagName", s:orange, "", "") 351 | call X("htmlEndTag", s:aqua, "", "") 352 | call X("htmlTitle", "", "", "none") 353 | 354 | " CSS Highlighting 355 | call X("cssIdentifier", s:red, "", "") 356 | call X("cssClassName", s:aqua, "", "") 357 | call X("cssTagName", s:yellow, "", "") 358 | call X("cssPseudoClass", s:purple, "", "") 359 | 360 | " JavaScript Highlighting 361 | call X("javaScriptFunction", s:purple, "", "") 362 | call X("javaScriptConditional", s:yellow, "", "") 363 | call X("javaScriptRepeat", s:purple, "", "") 364 | call X("javaScriptNumber", s:orange, "", "") 365 | call X("javaScriptMember", s:orange, "", "") 366 | call X("javaScriptParens", s:aqua, "", "") 367 | call X("javaScriptBrackets", s:aqua, "", "") 368 | call X("javaScriptBlocks", s:task_tag, "", "") 369 | call X("javaScriptLabel", s:red, "", "none") 370 | 371 | " HAML Highlighting 372 | call X("hamlTag", s:orange, "", "") 373 | call X("hamlAttributesDelimiter", s:aqua, "", "") 374 | 375 | " SASS Highlighting 376 | call X("sassClass", s:aqua, "", "") 377 | 378 | " CoffeeScript Highlighting 379 | call X("coffeeStatement", s:orange, "", "none") 380 | call X("coffeeConditional", s:yellow, "", "") 381 | call X("coffeeBracket", s:aqua, "", "none") 382 | call X("coffeeParen", s:aqua, "", "none") 383 | call X("coffeeRepeat", s:purple, "", "none") 384 | call X("coffeeKeyword", s:yellow, "", "none") 385 | call X("coffeeSpecialVar", s:blue, "", "none") 386 | 387 | " ZSH Highlighting 388 | call X("zshCommands", s:red, "", "none") 389 | call X("zshKeyword", s:blue, "", "none") 390 | 391 | " Diff Highlighting 392 | call X("DiffAdd", "", s:diff_green, "") 393 | call X("diffAdded", s:green, "", "") 394 | call X("DiffDelete", s:diff_blue, s:diff_red, "") 395 | call X("diffRemoved", s:red, "", "") 396 | call X("DiffChange", "", s:diff_orange, "") 397 | call X("DiffText", "", s:diff_blue, "none") 398 | 399 | " Fugitive Highlighting 400 | call X("gitcommitUntrackedFile", s:red, "", "") 401 | call X("gitcommitSelectedFile", s:green, "", "") 402 | 403 | " Delete Functions 404 | delf X 405 | delf rgb 406 | delf colour 407 | delf rgb_colour 408 | delf rgb_level 409 | delf rgb_number 410 | delf grey_colour 411 | delf grey_level 412 | delf grey_number 413 | 414 | " 256-color cterm fixes for theme colors 415 | if !has("gui_running") && &t_Co == 256 416 | hi CursorLine ctermbg=235 417 | hi DiffChange ctermbg=094 418 | hi Folded ctermbg=NONE 419 | hi Normal ctermbg=234 420 | hi StatusLine ctermfg=239 421 | hi StatusLineNC ctermfg=236 422 | hi TabLineFill ctermbg=234 423 | hi TabLineSel ctermbg=239 424 | hi Visual ctermbg=236 425 | endif 426 | endif 427 | --------------------------------------------------------------------------------