1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:40:04 +08:00

Theme support in mapping guide

This commit is contained in:
wsdjeg 2017-05-13 22:31:51 +08:00
parent 9cddb61cda
commit 30c34008f5
3 changed files with 25 additions and 5 deletions

View File

@ -399,11 +399,7 @@ function! s:winopen() " {{{
endfunction " }}}
function! s:updateStatusline() abort
hi! LeaderGuiderPrompt cterm=bold gui=bold guifg=#282828 guibg=#a89984
hi! LeaderGuiderSep1 cterm=bold gui=bold guifg=#a89984 guibg=#504945
hi! LeaderGuiderName cterm=bold gui=bold guifg=#a89984 guibg=#504945
hi! LeaderGuiderSep2 cterm=bold gui=bold guifg=#504945 guibg=#3c3836
hi! LeaderGuiderFill guifg=#a89984 guibg=#3c3836
call SpaceVim#mapping#guide#theme#hi()
let gname = get(s:guide_group, 'name', '')
if !empty(gname)
let gname = ' - ' . gname[1:]

View File

@ -0,0 +1,17 @@
function! SpaceVim#mapping#guide#theme#hi() abort
let name = get(g:, 'color_name', 'gruvbox')
try
let t = SpaceVim#mapping#guide#theme#{name}#template()
catch /^Vim\%((\a\+)\)\=:E117/
let t = SpaceVim#mapping#guide#theme#gruvbox#templete()
endtry
call s:hi(t)
endfunction
function! s:hi(t) abort
exe 'hi! LeaderGuiderPrompt cterm=bold gui=bold guifg=' . a:t[0][0] . ' guibg=' . a:t[0][1]
exe 'hi! LeaderGuiderSep1 cterm=bold gui=bold guifg=' . a:t[0][1] . ' guibg=' . a:t[1][1]
exe 'hi! LeaderGuiderName cterm=bold gui=bold guifg=' . a:t[1][0] . ' guibg=' . a:t[1][1]
exe 'hi! LeaderGuiderSep2 cterm=bold gui=bold guifg=' . a:t[1][1] . ' guibg=' . a:t[2][1]
exe 'hi! LeaderGuiderFill guifg=' . a:t[2][0] . ' guibg=' . a:t[2][1]
endfunction

View File

@ -0,0 +1,7 @@
function! SpaceVim#mapping#guide#theme#gruvbox#template() abort
return [
\ ['#282828', '#a89984'],
\ ['#a89984', '#504945'],
\ ['#a89984', '#3c3836']
\ ]
endfunction