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

Add statusline mode support

This commit is contained in:
unknown 2017-06-16 15:44:28 +08:00
parent 27406f4fa9
commit 49f4a1c26f
3 changed files with 22 additions and 1 deletions

View File

@ -63,6 +63,13 @@ function! s:battery_status() abort
endif
endfunction
function! s:check_mode() abort
if mode() =~ 'n'
elseif mode() =~ 'i'
elseif mode() =~ 'v'
endif
endfunction
function! s:search_status() abort
let ct = 0
let tt = 0
@ -255,6 +262,8 @@ function! SpaceVim#layers#core#statusline#init() abort
augroup END
endfunction
let s:colors_template = SpaceVim#mapping#guide#theme#gruvbox#palette()
function! SpaceVim#layers#core#statusline#def_colors() abort
let name = get(g:, 'colors_name', 'gruvbox')
try
@ -262,6 +271,7 @@ function! SpaceVim#layers#core#statusline#def_colors() abort
catch /^Vim\%((\a\+)\)\=:E117/
let t = SpaceVim#mapping#guide#theme#gruvbox#palette()
endtry
let s:colors_template = t
exe 'hi! SpaceVim_statusline_a ctermbg=' . t[0][2] . ' ctermfg=' . t[0][3] . ' guibg=' . t[0][1] . ' guifg=' . t[0][0]
exe 'hi! SpaceVim_statusline_b ctermbg=' . t[1][2] . ' ctermfg=' . t[1][3] . ' guibg=' . t[1][1] . ' guifg=' . t[1][0]
exe 'hi! SpaceVim_statusline_c ctermbg=' . t[2][2] . ' ctermfg=' . t[2][3] . ' guibg=' . t[2][1] . ' guifg=' . t[2][0]

View File

@ -79,5 +79,5 @@ function! SpaceVim#layers#unite#plugins() abort
endfunction
function! SpaceVim#layers#unite#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['!'], 'Unite output/shellcmd -start-insert', 'shell cmd', 1)
call SpaceVim#mapping#space#def('nnoremap', ['!'], 'Unite output/shellcmd -no-start-insert', 'shell cmd', 1)
endfunction

View File

@ -1,3 +1,14 @@
" the theme colors should be
" [
" \ [ a_guifg, a_guibg, a_ctermfg, a_ctermbg],
" \ [ b_guifg, b_guibg, b_ctermfg, b_ctermbg],
" \ [ c_guifg, c_guibg, c_ctermfg, c_ctermbg],
" \ [ z_guibg, z_ctermbg],
" \ [ i_guifg, i_guibg, i_ctermfg, i_ctermbg],
" \ [ v_guifg, v_guibg, v_ctermfg, v_ctermbg],
" \ ]
function! SpaceVim#mapping#guide#theme#gruvbox#palette() abort
return [
\ ['#282828', '#a89984', 246, 235],