mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-25 17:57:36 +08:00
parent
0c307d5f73
commit
a2e20bc3ca
|
@ -25,6 +25,7 @@ function! airline#init#bootstrap()
|
||||||
call s:check_defined('g:airline_detect_paste', 1)
|
call s:check_defined('g:airline_detect_paste', 1)
|
||||||
call s:check_defined('g:airline_detect_crypt', 1)
|
call s:check_defined('g:airline_detect_crypt', 1)
|
||||||
call s:check_defined('g:airline_detect_spell', 1)
|
call s:check_defined('g:airline_detect_spell', 1)
|
||||||
|
call s:check_defined('g:airline_detect_spelllang', 1)
|
||||||
call s:check_defined('g:airline_detect_iminsert', 0)
|
call s:check_defined('g:airline_detect_iminsert', 0)
|
||||||
call s:check_defined('g:airline_inactive_collapse', 1)
|
call s:check_defined('g:airline_inactive_collapse', 1)
|
||||||
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
||||||
|
|
|
@ -65,7 +65,17 @@ function! airline#parts#paste()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#parts#spell()
|
function! airline#parts#spell()
|
||||||
return g:airline_detect_spell && &spell ? g:airline_symbols.spell : ''
|
let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : ''
|
||||||
|
if g:airline_detect_spell && &spell
|
||||||
|
if winwidth(0) >= 90
|
||||||
|
return g:airline_symbols.spell . spelllang
|
||||||
|
elseif winwidth(0) >= 70
|
||||||
|
return g:airline_symbols.spell
|
||||||
|
else
|
||||||
|
return split(g:airline_symbols.spell, '\zs')[0]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! airline#parts#iminsert()
|
function! airline#parts#iminsert()
|
||||||
|
|
|
@ -131,6 +131,10 @@ values):
|
||||||
|
|
||||||
* enable spell detection >
|
* enable spell detection >
|
||||||
let g:airline_detect_spell=1
|
let g:airline_detect_spell=1
|
||||||
|
|
||||||
|
* display spelling language when spell detection is enabled
|
||||||
|
(if enough space is available) >
|
||||||
|
let g:airline_detect_spelllang=1
|
||||||
<
|
<
|
||||||
* enable iminsert detection >
|
* enable iminsert detection >
|
||||||
let g:airline_detect_iminsert=0
|
let g:airline_detect_iminsert=0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user