Skip to content

Instantly share code, notes, and snippets.

@chrisbra
Created March 20, 2017 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbra/babdca522dbc8b2e072310b3556965c4 to your computer and use it in GitHub Desktop.
Save chrisbra/babdca522dbc8b2e072310b3556965c4 to your computer and use it in GitHub Desktop.
" First, let's define an empty dictionary and assign it to the "palette"
" variable. The # is a separator that maps with the directory structure. If
" you get this wrong, Vim will complain loudly.
let g:airline#themes#dark_minimal#palette = {}
" First let's define some arrays. The s: is just a VimL thing for scoping the
" variables to the current script. Without this, these variables would be
" declared globally. Now let's declare some colors for normal mode and add it
" to the dictionary. The array is in the format:
" [ guifg, guibg, ctermfg, ctermbg, opts ]. See "help attr-list" for valid
" values for the "opt" value.
let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ]
let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ]
let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ]
let g:airline#themes#dark_minimal#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
" Accents are used to give parts within a section a slightly different look or
" color. Here we are defining a "red" accent, which is used by the 'readonly'
" part by default. Only the foreground colors are specified, so the background
" colors are automatically extracted from the underlying section colors. What
" this means is that regardless of which section the part is defined in, it
" will be red instead of the section's foreground color. You can also have
" multiple parts with accents within a section.
let g:airline#themes#dark_minimal#palette.accents = {
\ 'red': [ '#ff0000' , '' , 160 , '' ]
\ }
let pal = g:airline#themes#dark_minimal#palette
for item in ['insert', 'replace', 'visual', 'inactive', 'ctrlp']
" why doesn't this work?
" get E713: cannot use empty key for dictionary
"let pal.{item} = pal.normal
exe "let pal.".item." = pal.normal"
for suffix in ['_modified', '_paste']
exe "let pal.".item.suffix. " = pal.normal"
endfor
endfor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment