mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-01-19 09:32:47 +08:00
convert iminsert into a fragment.
This commit is contained in:
@@ -199,10 +199,6 @@ function! airline#extensions#load()
|
||||
call airline#extensions#readonly#init()
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#iminsert#enabled', 0) || get(g:, 'airline_detect_iminsert', 0)
|
||||
call airline#extensions#iminsert#init()
|
||||
endif
|
||||
|
||||
" load all other extensions not part of the default distribution
|
||||
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
||||
" check to see that both the resolved and unresolved paths do not match
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#iminsert#get_text()
|
||||
if &iminsert
|
||||
return toupper(get(b:, 'keymap_name', 'lang'))
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#iminsert#init()
|
||||
let g:airline_section_a .= ' '.g:airline_left_alt_sep.' %{airline#extensions#iminsert#get_text()}'
|
||||
endfunction
|
||||
|
||||
@@ -7,6 +7,13 @@ call extend(g:airline#fragments#symbols, {
|
||||
\ }, 'keep')
|
||||
|
||||
function! airline#fragments#get_paste()
|
||||
return &paste ? ' ' . g:airline#fragments#symbols.paste : ''
|
||||
return g:airline_detect_paste && &paste ? ' '.g:airline#fragments#symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#fragments#get_iminsert()
|
||||
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
|
||||
return ' '.g:airline_left_alt_sep.' '.toupper(b:keymap_name)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user