scriptencoding utf-8 " This is a copy of the dark.vim theme, however it does not change colors in " the different modes, so should bring some performance improvements because " airline does not have to redefine highlighting groups after they have been " setup once. " Each theme is contained in its own file and declares variables scoped to the " file. These variables represent the possible "modes" that airline can " detect. The mode is the return value of mode(), which gets converted to a " readable string. The following is a list currently supported modes: normal, " insert, replace, visual, and inactive. " " Each mode can also have overrides. These are small changes to the mode that " don't require a completely different look. "modified" and "paste" are two " such supported overrides. These are simply suffixed to the major mode, " separated by an underscore. For example, "normal_modified" would be normal " mode where the current buffer is modified. " " The theming algorithm is a 2-pass system where the mode will draw over all " parts of the statusline, and then the override is applied after. This means " it is possible to specify a subset of the theme in overrides, as it will " simply overwrite the previous colors. If you want simultaneous overrides, " then they will need to change different parts of the statusline so they do " not conflict with each other. " " 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