2018-04-14 00:50:26 +00:00
|
|
|
" Dracula Airline Theme: {{{
|
2016-04-04 02:16:54 +00:00
|
|
|
"
|
|
|
|
" Copyright 2016, All rights reserved
|
|
|
|
"
|
|
|
|
" Code licensed under the MIT license
|
|
|
|
" http://zenorocha.mit-license.org
|
|
|
|
"
|
|
|
|
" @author Extrante <extrante@gmail.com>
|
2016-05-08 07:57:49 +00:00
|
|
|
" @author Zeno Rocha <hi@zenorocha.com>
|
2018-04-14 00:50:26 +00:00
|
|
|
"}}}
|
|
|
|
" Helpers: {{{
|
|
|
|
|
|
|
|
" Takes a foreground color name, background color name, and optionally one or
|
|
|
|
" more attr-list items as input, transforms it to the format accepted by
|
|
|
|
" airline#themes#generate_color_map and returns that value
|
|
|
|
func! s:clr(fg, bg, ...)
|
2019-05-25 21:50:22 +00:00
|
|
|
let l:fg = g:dracula#palette[a:fg]
|
|
|
|
let l:bg = g:dracula#palette[a:bg]
|
|
|
|
return [ l:fg[0], l:bg[0], l:fg[1], l:bg[1] ] +
|
2019-05-28 23:08:04 +00:00
|
|
|
\ filter(copy(a:000), 'type(v:val) == 1 && len(v:val) > 0')
|
2018-04-14 00:50:26 +00:00
|
|
|
endfunc
|
|
|
|
|
|
|
|
" Takes three ['fg', 'bg'] color lists and optionally a dictionary of extra
|
|
|
|
" key-value pairs and returns the value generated by
|
|
|
|
" airline#themes#generate_color_map after optionally merging the dictionary of
|
|
|
|
" extra key-value pairs.
|
|
|
|
"
|
|
|
|
" a:a -> airline_a, airline_x
|
|
|
|
" a:b -> airline_b, airline_y
|
|
|
|
" a:c -> airline_c, airline_z
|
|
|
|
func! s:color_map(a, b, c, ...)
|
|
|
|
if a:0 == 0
|
|
|
|
return call('airline#themes#generate_color_map', [call('s:clr', a:a), call('s:clr', a:b), call('s:clr', a:c)])
|
|
|
|
else
|
|
|
|
return call('extend', [ call('airline#themes#generate_color_map', [call('s:clr', a:a), call('s:clr', a:b), call('s:clr', a:c)]) ] + a:000)
|
|
|
|
endif
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
"}}}
|
|
|
|
|
|
|
|
let g:airline#themes#dracula#palette = {
|
|
|
|
\ 'normal': s:color_map(
|
|
|
|
\ ['bg', 'purple'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'selection'],
|
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
|
|
|
\ ),
|
|
|
|
\ 'normal_modified': s:color_map(
|
|
|
|
\ ['bg', 'purple'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'bgdark'],
|
2019-02-23 21:08:48 +00:00
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ),
|
|
|
|
\ 'insert': s:color_map(
|
|
|
|
\ ['bg', 'green'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'selection'],
|
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
|
|
|
\ ),
|
|
|
|
\ 'insert_modified': s:color_map(
|
|
|
|
\ ['bg', 'green'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'bgdark'],
|
2019-03-16 17:39:04 +00:00
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ),
|
|
|
|
\ 'replace': s:color_map(
|
|
|
|
\ ['bg', 'orange'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'selection'],
|
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
|
|
|
\ ),
|
|
|
|
\ 'replace_modified': s:color_map(
|
|
|
|
\ ['bg', 'orange'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'bgdark'],
|
2019-03-16 17:39:04 +00:00
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ),
|
|
|
|
\ 'visual': s:color_map(
|
|
|
|
\ ['bg', 'yellow'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'selection'],
|
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
|
|
|
\ ),
|
|
|
|
\ 'visual_modified': s:color_map(
|
|
|
|
\ ['bg', 'yellow'],
|
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'bgdark'],
|
2019-03-16 17:39:04 +00:00
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ),
|
|
|
|
\ 'inactive': s:color_map(
|
2019-11-27 16:59:43 +00:00
|
|
|
\ ['bg', 'comment'],
|
|
|
|
\ ['fg', 'bgdark'],
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ['fg', 'selection'],
|
2019-02-23 21:08:48 +00:00
|
|
|
\ {
|
|
|
|
\ 'airline_warning': s:clr('bg', 'orange'),
|
|
|
|
\ 'airline_error': s:clr('bg', 'red'),
|
|
|
|
\ },
|
2018-04-14 00:50:26 +00:00
|
|
|
\ ),
|
2019-04-02 00:56:39 +00:00
|
|
|
\ 'terminal': s:color_map(
|
2020-06-22 17:11:29 +00:00
|
|
|
\ ['bg', 'green'],
|
2019-04-02 00:56:39 +00:00
|
|
|
\ ['fg', 'comment'],
|
|
|
|
\ ['fg', 'selection'],
|
|
|
|
\ {
|
|
|
|
\ 'airline_term': s:clr('fg', 'selection'),
|
|
|
|
\ },
|
|
|
|
\ ),
|
2018-04-14 00:50:26 +00:00
|
|
|
\}
|
|
|
|
|
|
|
|
" Extensions: {{{
|
2018-06-20 02:08:29 +00:00
|
|
|
" Tabline: {{{
|
|
|
|
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
|
|
|
let g:airline#themes#dracula#palette.tabline = {
|
2018-10-22 19:07:43 +00:00
|
|
|
\ 'airline_tabfill': s:clr('bg', 'bglight'),
|
2018-06-20 02:08:29 +00:00
|
|
|
\
|
|
|
|
\ 'airline_tab': s:clr('comment', 'bg'),
|
2018-10-22 19:07:43 +00:00
|
|
|
\ 'airline_tabsel': s:clr('bg', 'purple'),
|
2018-06-20 02:08:29 +00:00
|
|
|
\ 'airline_tabmod': s:clr('green', 'bg'),
|
|
|
|
\
|
|
|
|
\ 'airline_tab_right': s:clr('comment', 'bg'),
|
2018-10-22 19:07:43 +00:00
|
|
|
\ 'airline_tabsel_right': s:clr('fg', 'bg', ),
|
2018-06-20 02:08:29 +00:00
|
|
|
\ 'airline_tabmod_right': s:clr('green', 'bg'),
|
|
|
|
\}
|
|
|
|
endif
|
|
|
|
"}}}
|
2018-04-14 00:50:26 +00:00
|
|
|
" CtrlP: {{{2
|
|
|
|
if exists('g:loaded_ctrlp')
|
|
|
|
let g:airline#themes#dracula#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
|
|
|
\ s:clr('fg', 'selection'),
|
|
|
|
\ s:clr('fg', 'comment'),
|
|
|
|
\ s:clr('fg', 'purple'),
|
|
|
|
\)
|
2016-04-04 02:16:54 +00:00
|
|
|
endif
|
2018-04-14 00:50:26 +00:00
|
|
|
"}}}2
|
|
|
|
"}}}
|
2016-04-04 02:16:54 +00:00
|
|
|
|
2019-05-25 21:50:22 +00:00
|
|
|
" vim: fdm=marker ts=2 sts=2 sw=2 fdl=0:
|