[nvim] make the airline theme match my syntax theme even more

This commit is contained in:
Dmytro Meleshko 2021-01-20 17:37:55 +02:00
parent b751287736
commit d42428538c

View file

@ -1,4 +1,12 @@
let s:palette = {} let s:palette = {
\ "inactive" : {},
\ "replace" : {},
\ "normal" : {},
\ "visual" : {},
\ "insert" : {},
\ "terminal" : {},
\ "commandline" : {},
\ }
let s:colors = g:dotfiles_colorscheme_base16_colors let s:colors = g:dotfiles_colorscheme_base16_colors
function! s:base16_color(fg, bg) function! s:base16_color(fg, bg)
@ -16,9 +24,11 @@ let s:palette.normal = airline#themes#generate_color_map(
\ s:section_c) \ s:section_c)
let s:section_a_overrides = { let s:section_a_overrides = {
\ 'insert' : s:base16_color(0x1, 0xD), \ 'insert' : s:base16_color(0x1, 0xD),
\ 'replace': s:base16_color(0x1, 0x8), \ 'visual' : s:base16_color(0x1, 0xE),
\ 'visual' : s:base16_color(0x1, 0xE), \ 'replace' : s:base16_color(0x1, 0x8),
\ 'terminal' : s:base16_color(0x1, 0xD),
\ 'commandline' : s:base16_color(0x1, 0xC),
\ } \ }
for [s:mode, s:color] in items(s:section_a_overrides) for [s:mode, s:color] in items(s:section_a_overrides)
let s:palette[s:mode] = { 'airline_a': s:color, 'airline_z': s:color } let s:palette[s:mode] = { 'airline_a': s:color, 'airline_z': s:color }
@ -40,4 +50,10 @@ if get(g:, 'loaded_ctrlp', 0)
\ s:ctrlp_white) \ s:ctrlp_white)
endif endif
for s:mode in keys(s:palette)
let s:palette[s:mode]['airline_warning'] = s:base16_color(0x0, 0xA)
let s:palette[s:mode]['airline_error'] = s:base16_color(0x0, 0x8)
let s:palette[s:mode]['airline_term'] = s:base16_color(0x9, 0x1)
endfor
let airline#themes#dotfiles#palette = s:palette let airline#themes#dotfiles#palette = s:palette