├── doc └── nefertiti.vim ├── README.md └── colors └── nefertiti.vim /doc/nefertiti.vim: -------------------------------------------------------------------------------- 1 | *nefertiti.txt* For Vim version 7.3 Last change: 2014 May 31 2 | 3 | =============================================================================== 4 | *nefertiti* *nefertiti-contents* 5 | CONTENTS~ 6 | 7 | 1. Options and Settings ................................ |nefertiti-options| 8 | 2. Commands ........................................... |nefertiti-commands| 9 | 3. Key Mappings ....................................... |nefertiti-key-maps| 10 | 11 | =============================================================================== 12 | *nefertiti-options* 13 | OPTIONS AND SETTINGS~ 14 | 15 | g:nefertiti_base_brightness_level~ *g:nefertiti_base_brightness_level* 16 | Default: 12 17 | Integer value between 0 and 25, inclusive, specifying starting or base 18 | brightness level. If not specified, then defaults to middle brightness. 19 | 20 | g:nefertiti_suppress_keymaps~ *g:nefertiti_suppress_keymaps* 21 | Default: 0 22 | If specified as 1, then key-mappings to control Nefertiti brightness levels 23 | will not be automatically created. 24 | 25 | =============================================================================== 26 | *nefertiti-commands* 27 | COMMANDS~ 28 | 29 | :NefertitiBrighten [{levels}] *:NefertitiBrighten* 30 | Darken colors by {levels} levels, where {levels} is an integer value. 31 | If {levels} is not given, it defaults to 1. 32 | 33 | :NefertitiDarken [{levels}] *:NefertitiDarken* 34 | Darken colors by {levels} levels, where {levels} is an integer value. 35 | If {levels} is not given, it defaults to 1. 36 | 37 | :NefertitiReset *:NefertitiReset* 38 | Set brightness back to default (base) levels. 39 | 40 | :NefertitiColors *:NefertitiColors* 41 | Set/activate the color scheme. Equivalent to: 42 | > 43 | :colors nefertiti 44 | < 45 | =============================================================================== 46 | *nefertiti-key-maps* 47 | KEY MAPPINGS~ 48 | 49 | If |g:nefertiti_suppress_keymaps| is not specified or 1, then the following 50 | keys will be mapped automatically: 51 | 52 | Brightens the colors. 53 | Darkens the colors. 54 | Resets the brightness to default levels. 55 | 56 | If you want to define your own key mappings, then add something like the 57 | following to your '~/.vimrc': 58 | > 59 | let g:nefertiti_suppress_keymaps = 1 60 | map NefertitiDarken 61 | map NefertitiBrighten 62 | map NefertitiReset 63 | < 64 | vim:tw=78:ts=8:ft=help:norl: 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nefertiti 2 | 3 | 4 | 5 | 6 | A warm dark-background color scheme for Vim (previously known as "MochaLatte"), 7 | featuring dynamic control of brightness-levels as needed. 8 | 9 | Brighten select (normal and syntax) colors with "`:NefertitiBrighten`", or 10 | darken them with "`:NefertitiDarken`". Conveniently bound to "`META-2`" and 11 | "`META-1`", respectively, but you can, of course, suppress the key mappings 12 | and/or replace them with others of your own preference. 13 | 14 | **NOTE**: GUI Vim only at the present time. 15 | 16 | ## Installation 17 | 18 | ### [Pathogen](https://github.com/tpope/vim-pathogen) 19 | 20 | $ cd ~/.vim/bundle 21 | $ git clone git://github.com/jeetsukumaran/vim-nefertiti 22 | 23 | ### [Vundle](https://github.com/VundleVim/Vundle.vim) 24 | 25 | :BundleInstall jeetsukumaran/vim-nefertiti 26 | 27 | ### Manually 28 | 29 | Copy the file "`colors/nefertiti.vim`" to your "`~.vim/colors/`" 30 | subdirectory. 31 | 32 | ### Updating from "MochaLatte" 33 | 34 | This color scheme was previously known as "MochaLatte", as was the repository. If you cloned this repository from its "MochaLatte" days, everything should still work fine, though you will probably need to update your "~/.vimrc" to set the color scheme correctly. 35 | 36 | If you installed this color scheme as a Git submodule, you might want to update by: 37 | 38 | $ cd ~/.vim/bundle 39 | $ git submodule deinit vim-mochalatte 40 | $ git submodule add git://github.com/jeetsukumaran/vim-nefertiti vim-nefertiti 41 | $ git commit -a -m "Updated MochaLatte to Nefertiti" 42 | 43 | ## Usage 44 | 45 | As with any other color scheme, simply use the "`:colorscheme`" command, e.g.: 46 | 47 | :colors nefertiti 48 | 49 | To set the color scheme permanently, add the following to your "`~/.vimrc`": 50 | 51 | if has("gui") 52 | colorscheme nefertiti 53 | endif 54 | 55 | Three commands are provided to control the brightness levels: "`:NefertitiBrighten`", "`:NefertitiDarken`", and "`NefertitiReset`"; see [the help](https://github.com/jeetsukumaran/vim-nefertiti/blob/master/doc/nefertiti.vim) for more details. 56 | 57 | By default, "`META-2`" ("`ALT-2`" on some keyboards) increases the brightness of the text while "`META-1`" ("`ALT-1`" on some keyboards) decreases the brightness of text. These key-mappings can be suppressed and or customized: see [the help](https://github.com/jeetsukumaran/vim-nefertiti/blob/master/doc/nefertiti.vim) for more details. 58 | 59 | Note that for the default (or any other "`META`" or "`ALT`") key mappings to 60 | work, if you are using [MacVim](https://github.com/macvim-dev/macvim), you will 61 | also need something like the following in your "`~/.vimrc`": 62 | 63 | if has("gui_macvim") 64 | set macmeta 65 | endif 66 | 67 | ## Samples 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /colors/nefertiti.vim: -------------------------------------------------------------------------------- 1 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | "" Nefertiti Vim Color Scheme 3 | "" (C) Copyright 2014 Jeet Sukumaran 4 | "" Released under the BSD License 5 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 6 | 7 | " General Setup {{{1 8 | set background=dark 9 | hi clear 10 | if exists("syntax_on") 11 | syntax reset 12 | endif 13 | let colors_name = "nefertiti" 14 | " }}}1 15 | 16 | " Code Setup {{{1 17 | if !exists("g:did_nefertiti_code_setup") 18 | 19 | " Preamble {{{2 20 | let g:did_nefertiti_code_setup = 1 21 | let s:save_cpo = &cpo 22 | " }}}2 23 | 24 | " Dynamic Colors Base Definitions {{{2` 25 | let s:nefertiti_dynamic_colors = {} 26 | let s:nefertiti_dynamic_colors["Normal"] = [ [0xdd, 0xd6, 0xc0], [], "guibg=#2c2824 gui=NONE" ] 27 | let s:nefertiti_dynamic_colors["NonText"] = [ [0x66, 0x60, 0x46], [], "guibg=bg gui=NONE" ] 28 | let s:nefertiti_dynamic_colors["Folded"] = [ [0x88, 0x80, 0x78], [0x3c, 0x34, 0x34], "gui=italic" ] 29 | let s:nefertiti_dynamic_colors["Comment"] = [ [0x70, 0x70, 0x70], [], "gui=italic" ] 30 | let s:nefertiti_dynamic_colors["Boolean"] = [ [0xff, 0x98, 0x00], [], "gui=NONE" ] 31 | let s:nefertiti_dynamic_colors["String"] = [ [0xaa, 0xaa, 0x99], [], "gui=NONE" ] 32 | let s:nefertiti_dynamic_colors["Identifier"] = [ [0x99, 0x88, 0x77], [], "gui=NONE" ] 33 | let s:nefertiti_dynamic_colors["Function"] = [ [0xdd, 0xcc, 0xa8], [], "gui=NONE" ] 34 | let s:nefertiti_dynamic_colors["Type"] = [ [0x99, 0x66, 0x44], [], "gui=NONE" ] 35 | let s:nefertiti_dynamic_colors["Statement"] = [ [0x90, 0x9a, 0x9f], [], "gui=NONE" ] 36 | let s:nefertiti_dynamic_colors["Keyword"] = [ [0x90, 0x9a, 0x9f], [], "gui=NONE" ] 37 | let s:nefertiti_dynamic_colors["Constant"] = [ [0xff, 0x98, 0x00], [], "gui=NONE" ] 38 | let s:nefertiti_dynamic_colors["Number"] = [ [0xcc, 0x88, 0x00], [], "gui=NONE" ] 39 | let s:nefertiti_dynamic_colors["Special"] = [ [0x71, 0x96, 0x11], [], "gui=NONE" ] 40 | let s:nefertiti_dynamic_colors["PreProc"] = [ [0xbb, 0xaa, 0x88], [], "gui=NONE" ] 41 | let s:nefertiti_dynamic_colors["Title"] = [ [0x77, 0x88, 0x88], [], "gui=NONE" ] 42 | let s:nefertiti_dynamic_colors["Todo"] = [ [0x8f, 0x6f, 0x8f], [], "guibg=#202020 gui=italic,underline,bold" ] 43 | let s:nefertiti_dynamic_colors["pythonExClass"] = [ [0x99, 0x76, 0x76], [], "guibg=NONE gui=NONE" ] 44 | let s:nefertiti_dynamic_colors["pythonDecorator"] = [ [0x88, 0x77, 0x44], [], "guibg=NONE gui=NONE" ] 45 | " }}}2 46 | 47 | " Dynamic Colors State Tracking Variables {{{2 48 | let s:nefertiti_brightness_levels = range(-96, 96, 8) 49 | let s:nefertiti_brightness_level_max = len(s:nefertiti_brightness_levels) - 1 50 | let s:nefertiti_brightness_level_min = 0 51 | let s:nefertiti_default_brightness_level = index(s:nefertiti_brightness_levels, 0) 52 | let g:nefertiti_base_brightness_level = get(g:, 'nefertiti_base_brightness_level', s:nefertiti_default_brightness_level) 53 | let g:nefertiti_current_brightness_level = g:nefertiti_base_brightness_level 54 | let g:nefertiti_base_search_highlight_intensity = get(g:, 'nefertiti_base_search_highlight_intensity', 4) 55 | let g:nefertiti_current_search_highlight_intensity = g:nefertiti_base_search_highlight_intensity 56 | " }}}2 57 | 58 | " Special Case Search Highlight Intensity {{{2 59 | let s:_nefertiti_search_highlight_intensity_highlight_map = ["333333", "555555", "666660", "aaaa99", "ddddbb", "ffffbb", "ffffff", "ff00ff"] 60 | " }}}2 61 | 62 | " Functions {{{2 63 | function! s:_nefertiti_change_brightness(step, up) "{{{3 64 | if empty(a:step) 65 | let l:level_step = 1 66 | else 67 | let l:level_step = a:step + 0 68 | endif 69 | if a:up 70 | let g:nefertiti_current_brightness_level += l:level_step 71 | else 72 | let g:nefertiti_current_brightness_level -= l:level_step 73 | endif 74 | call s:_nefertiti_validate_brightness_level() 75 | colorscheme nefertiti 76 | endfunction "}}}3 77 | 78 | function! s:_nefertiti_validate_brightness_level() "{{{3 79 | if g:nefertiti_current_brightness_level < s:nefertiti_brightness_level_min 80 | let g:nefertiti_current_brightness_level = s:nefertiti_brightness_level_min 81 | elseif g:nefertiti_current_brightness_level > s:nefertiti_brightness_level_max 82 | let g:nefertiti_current_brightness_level = s:nefertiti_brightness_level_max 83 | endif 84 | endfunction "}}}3 85 | 86 | function! s:_nefertiti_reset_brightness() "{{{3 87 | let g:nefertiti_current_brightness_level = g:nefertiti_base_brightness_level 88 | colorscheme nefertiti 89 | endfunction "}}}3 90 | 91 | function! s:_nefertiti_search_highlight_intensity(step, up) "{{{3 92 | if empty(a:step) 93 | let l:level_step = 1 94 | else 95 | let l:level_step = a:step + 0 96 | endif 97 | if a:up 98 | let g:nefertiti_current_search_highlight_intensity += l:level_step 99 | else 100 | let g:nefertiti_current_search_highlight_intensity -= l:level_step 101 | endif 102 | call s:_nefertiti_set_search_highlight() 103 | colorscheme nefertiti 104 | endfunction "}}}3 105 | 106 | function! s:_nefertiti_set_search_highlight() "{{{3 107 | if g:nefertiti_current_search_highlight_intensity < 0 108 | let g:nefertiti_current_search_highlight_intensity = len(s:_nefertiti_search_highlight_intensity_highlight_map) - 1 109 | elseif g:nefertiti_current_search_highlight_intensity >= len(s:_nefertiti_search_highlight_intensity_highlight_map) 110 | let g:nefertiti_current_search_highlight_intensity = 0 111 | endif 112 | execute "hi Search guibg=#" . s:_nefertiti_search_highlight_intensity_highlight_map[g:nefertiti_current_search_highlight_intensity] . " guifg=#000000 gui=bold" 113 | endfunction "}}}3 114 | 115 | function! s:_nefertiti_set_stable_colors() "{{{3 116 | """ Cursor {{{4 117 | hi Cursor guifg=NONE guibg=#626262 gui=NONE 118 | hi nCursor guifg=black guibg=green1 gui=NONE 119 | hi vCursor guifg=black guibg=magenta gui=NONE 120 | hi iCursor guifg=black guibg=#f08080 gui=NONE 121 | hi cCursor gui=reverse 122 | """ }}}4 123 | """ Cursor Line/Column {{{4 124 | hi CursorColumn guibg=#000000 125 | hi CursorLine guibg=#000000 126 | hi CursorLineNr guifg=#ffee99 guibg=bg gui=none 127 | hi ColorColumn guibg=#383535 128 | """ }}}4 129 | """ Structural {{{4 130 | hi LineNr guifg=#807060 guibg=#000000 gui=NONE 131 | hi SignColumn guifg=#333344 guibg=#363636 gui=NONE 132 | hi StatusLine guifg=#000000 guibg=#9d9080 gui=bold 133 | hi StatusLineNC guifg=#000000 guibg=#48403a gui=italic 134 | hi VertSplit guifg=#48403a guibg=#48403a gui=NONE 135 | hi FoldColumn guifg=#68838b guibg=#4B4B4B gui=bold 136 | """ }}}4 137 | """ Tabs {{{4 138 | hi TabLine guifg=#ddd6c0 guibg=#9d9080 gui=NONE 139 | hi TabLineFill guifg=#9d9080 guibg=#ddd6c0 gui=reverse 140 | hi TabLineSel guibg=#2c2824 guifg=#ddd6c0 gui=bold 141 | """ }}}4 142 | """ Search {{{4 143 | hi IncSearch guifg=#000000 guibg=#ff8800 gui=BOLD 144 | " hi Search guifg=#000000 guibg=#ffffbb gui=BOLD 145 | """ }}}4 146 | """ Selection {{{4 147 | hi Visual guifg=#000000 guibg=#768798 gui=NONE 148 | """ }}}4 149 | """ Pop-up Menus {{{4 150 | hi Pmenu guifg=#000000 guibg=#ccc0aa 151 | hi PmenuSel guifg=#000000 guibg=#ee9944 152 | """ }}}4 153 | """ Messaging {{{4 154 | hi ModeMsg guifg=#000000 guibg=#00ff00 gui=bold 155 | hi MoreMsg guifg=#2e8b57 guibg=bg gui=bold 156 | hi ErrorMsg guifg=#ff6a6a guibg=NONE gui=bold 157 | hi WarningMsg guifg=#ee9a00 guibg=bg gui=NONE 158 | """ }}}4 159 | """ Spelling {{{4 160 | hi SpellBad guisp=#ee2c2c gui=undercurl 161 | hi SpellCap guisp=#0000ff gui=undercurl 162 | hi SpellLocal guisp=#008b8b gui=undercurl 163 | hi SpellRare guisp=#ff00ff gui=undercurl 164 | """ }}}4 165 | """ Diff {{{4 166 | hi DiffAdd guibg=#445544 gui=NONE 167 | hi DiffDelete guibg=#554422 gui=NONE 168 | hi DiffChange guibg=#224455 gui=NONE 169 | hi DiffText guibg=#224455 guifg=#00ffff gui=underline 170 | """ }}}4 171 | """ Other {{{4 172 | hi Directory guifg=#ddaa66 guibg=bg gui=NONE 173 | hi MatchParen guifg=#fff000 guibg=bg gui=bold 174 | hi SpecialKey guifg=#cc6644 guibg=bg gui=bold 175 | hi WildMenu guifg=#000000 guibg=#87ceeb gui=NONE 176 | """ Special Syntax {{{4 177 | hi link pythonDecoratorFunction pythonDecorator 178 | """ }}}4 179 | endfunction "}}}3 180 | 181 | function! s:_nefertiti_set_dynamic_colors() "{{{3 182 | call s:_nefertiti_validate_brightness_level() 183 | let brightness_boost = s:nefertiti_brightness_levels[g:nefertiti_current_brightness_level] 184 | for highlight_name in keys(s:nefertiti_dynamic_colors) 185 | let fg_rgb_list = copy(s:nefertiti_dynamic_colors[highlight_name][0]) 186 | let bg_rgb_list = copy(s:nefertiti_dynamic_colors[highlight_name][1]) 187 | let other = s:nefertiti_dynamic_colors[highlight_name][2] 188 | if !empty(fg_rgb_list) 189 | for idx in range(len(fg_rgb_list)) 190 | let c = fg_rgb_list[idx] + brightness_boost 191 | if c > 255 192 | let c = 255 193 | elseif c < 0 194 | let c = 0 195 | endif 196 | let fg_rgb_list[idx] = c 197 | endfor 198 | let fg = "guifg=#" . printf("%02x%02x%02x", fg_rgb_list[0], fg_rgb_list[1], fg_rgb_list[2]) 199 | else 200 | let fg = "" 201 | endif 202 | if !empty(bg_rgb_list) 203 | for idx in range(len(bg_rgb_list)) 204 | let c = bg_rgb_list[idx] + brightness_boost 205 | if c > 255 206 | let c = 255 207 | elseif c < 0 208 | let c = 0 209 | endif 210 | let bg_rgb_list[idx] = c 211 | endfor 212 | let bg = "guibg=#" . printf("%02x%02x%02x", bg_rgb_list[0], bg_rgb_list[1], bg_rgb_list[2]) 213 | else 214 | let bg = "" 215 | endif 216 | execute "highlight " . highlight_name . " " . fg . " " . bg . " " . other 217 | endfor 218 | endfunction "}}}3 219 | 220 | function! s:_nefertiti_set_colors() "{{{3 221 | call s:_nefertiti_set_stable_colors() 222 | call s:_nefertiti_set_dynamic_colors() 223 | call s:_nefertiti_set_search_highlight() 224 | endfunction "}}}3 225 | " }}}2 226 | 227 | " Epilogue {{{2 228 | let &cpo = s:save_cpo 229 | " }}}2 230 | 231 | " }}}1 232 | 233 | " Public Interface Setup {{{1 234 | 235 | " Commands {{{2 236 | command! -nargs=? NefertitiDarken :call _nefertiti_change_brightness(, 0) 237 | command! -nargs=? NefertitiBrighten :call _nefertiti_change_brightness(, 1) 238 | command! -nargs=0 NefertitiReset :call _nefertiti_reset_brightness() 239 | command! -nargs=0 NefertitiColors :call _nefertiti_set_colors() 240 | command! -nargs=? NefertitiSearchDarken :call _nefertiti_search_highlight_intensity(, 0) 241 | command! -nargs=? NefertitiSearchBrighten :call _nefertiti_search_highlight_intensity(, 1) 242 | " }}}2 243 | 244 | " Key Maps {{{2 245 | nnoremap NefertitiBrighten :NefertitiBrighten 246 | nnoremap NefertitiDarken :NefertitiDarken 247 | nnoremap NefertitiReset :NefertitiReset 248 | nnoremap NefertitiSearchBrighten :NefertitiSearchBrighten 249 | nnoremap NefertitiSearchDarken :NefertitiSearchDarken 250 | if !exists('g:nefertiti_suppress_keymaps') || !g:nefertiti_suppress_keymaps 251 | map NefertitiDarken 252 | map NefertitiBrighten 253 | map NefertitiReset 254 | map NefertitiSearchDarken 255 | map NefertitiSearchBrighten 256 | endif 257 | " }}}2 258 | 259 | endif 260 | " }}}1 261 | 262 | " Set Colors {{{1 263 | :NefertitiColors 264 | " }}}1 265 | 266 | " Clean Up {{{1 267 | " Set background again -- for some reason, this does not always 'take 268 | set background=dark 269 | " }}}1 270 | --------------------------------------------------------------------------------