diff --git a/autoload/airline.vim b/autoload/airline.vim index 208fa2c..952a080 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -148,7 +148,9 @@ function! airline#check_mode(winnr) if get(w:, 'airline_active', 1) let l:m = mode(1) - if l:m[0] ==# "i" + if l:m ==# "i" + let l:mode = ['insert'] + elseif l:m[0] ==# "i" let l:mode = ['insert'] elseif l:m ==# "Rv" let l:mode =['replace'] @@ -160,10 +162,15 @@ function! airline#check_mode(winnr) let l:mode = ['terminal'] elseif l:m[0] ==# "c" let l:mode = ['commandline'] + elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode + let l:mode = ['normal'] + elseif l:m[0:1] ==# 'ni' + let l:mode = ['normal'] + let l:m = 'ni' else let l:mode = ['normal'] endif - if l:m !=# 'Rv' + if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1 let l:m = l:m[0] endif let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index e860258..4b88a94 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -36,8 +36,12 @@ function! airline#init#bootstrap() call s:check_defined('g:airline_mode_map', {}) call extend(g:airline_mode_map, { \ '__' : '------', - \ 'n' : 'NORMAL', \ 'i' : 'INSERT', + \ 'ic' : 'INSERT COMPL', + \ 'ix' : 'INSERT COMPL', + \ 'n' : 'NORMAL', + \ 'ni' : '(INSERT)', + \ 'no' : 'OP PENDING', \ 'R' : 'REPLACE', \ 'v' : 'VISUAL', \ 'V' : 'V-LINE',