From c16cafb2bb3640a01d8ba92830a0495bd1f6bca2 Mon Sep 17 00:00:00 2001 From: Kirill Klenov Date: Wed, 24 Jul 2013 15:35:31 +0400 Subject: [PATCH] Support &iminsert. --- autoload/airline.vim | 7 +++++++ doc/airline.txt | 3 +++ plugin/airline.vim | 1 + 3 files changed, 11 insertions(+) diff --git a/autoload/airline.vim b/autoload/airline.vim index e77e13b..85b1e33 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -163,6 +163,13 @@ function! airline#update_highlight() let l:mode = ['normal'] endif let g:airline_current_mode_text = get(g:airline_mode_map, l:m, l:m) + if g:airline_detect_iminsert && &iminsert + if exists('b:keymap_name') + let g:airline_current_mode_text .= ' ' . toupper(b:keymap_name) + else + let g:airline_current_mode_text .= ' LANG' + endif + endif else let l:mode = ['inactive'] endif diff --git a/doc/airline.txt b/doc/airline.txt index f8e1b00..2876834 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -68,6 +68,9 @@ values): > let g:airline_detect_paste=1 < +* enable iminsert detection +> + let g:airline_detect_iminsert=1 * change the default theme > diff --git a/plugin/airline.vim b/plugin/airline.vim index 4a13995..4778ce3 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -15,6 +15,7 @@ call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_font call s:check_defined('g:airline_enable_bufferline', 1) call s:check_defined('g:airline_enable_fugitive', 1) call s:check_defined('g:airline_enable_syntastic', 1) +call s:check_defined('g:airline_detect_iminsert', 1) call s:check_defined('g:airline_detect_modified', 1) call s:check_defined('g:airline_detect_paste', 1) call s:check_defined('g:airline_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'')