I use Vim with two keyboard layouts, English and Russian, and to be able to use Vim commands irrespective to the current layout, I have the following snippet in my .vimrc:
" To switch between keyboard layouts, use Control+^ or Control+Space
if g:os ==# 'Darwin'
set keymap=russian-jcukenmac
elseif g:os ==# 'Linux' || g:os ==# 'Windows'
set keymap=russian-jcukenwin
endif
set iminsert=0 imsearch=-1
nnoremap <silent> <C-Space> a<C-^><Esc>
vnoremap <silent> <C-Space> <Esc>a<C-^><Esc>gv
inoremap <silent> <C-Space> <C-^>X<Esc>a<C-H>
cnoremap <silent> <C-Space> <C-^>
I want to improve it by adding an indicator in the status line, so that the status line will look as follows:
file.md utf-8 unix markdown [en]
file.md utf-8 unix markdown [ru]
How is it possible? (The question is about adding [en]
and [ru]
flags only.)