mode: add several new modes

fixes #2499 #2498
This commit is contained in:
Christian Brabandt
2022-02-06 22:06:11 +01:00
parent 031e6ee4b2
commit 24f2878080
2 changed files with 74 additions and 38 deletions

View File

@@ -32,27 +32,63 @@ function! airline#init#bootstrap()
call s:check_defined('g:airline_exclude_filetypes', [])
call s:check_defined('g:airline_exclude_preview', 0)
" If g:airline_mode_map_codes is set to 1 in your .vimrc it will display
" only the modes' codes in the status line. Refer :help mode() for codes.
" That may be a preferred presentation because it is minimalistic.
call s:check_defined('g:airline_mode_map_codes', 0)
call s:check_defined('g:airline_mode_map', {})
call extend(g:airline_mode_map, {
if g:airline_mode_map_codes != 1
" If you prefer different mode names than those below they can be
" customised by inclusion in your .vimrc - for example, including just:
" let g:airline_mode_map = {
" \ 'Rv' : 'VIRTUAL REPLACE',
" \ 'niV' : 'VIRTUAL REPLACE (NORMAL)',
" \ }
" ...would override 'Rv' and 'niV' below respectively.
call extend(g:airline_mode_map, {
\ '__' : '------',
\ 'c' : 'COMMAND',
\ 'i' : 'INSERT',
\ 'ic' : 'INSERT COMPL',
\ 'ix' : 'INSERT COMPL',
\ 'multi' : 'MULTI',
\ 'n' : 'NORMAL',
\ 'ni' : '(INSERT)',
\ 'n' : 'NORMAL',
\ 'no' : 'OP PENDING',
\ 'R' : 'REPLACE',
\ 'Rv' : 'V REPLACE',
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ 't' : 'TERMINAL',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ 'nov' : 'OP PENDING CHAR',
\ 'noV' : 'OP PENDING LINE',
\ 'no' : 'OP PENDING BLOCK',
\ 'niI' : 'INSERT (NORMAL)',
\ 'niR' : 'REPLACE (NORMAL)',
\ 'niV' : 'V REPLACE (NORMAL)',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ '' : 'V-BLOCK',
\ }, 'keep')
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ 'i' : 'INSERT',
\ 'ic' : 'INSERT COMPL GENERIC',
\ 'ix' : 'INSERT COMPL',
\ 'R' : 'REPLACE',
\ 'Rc' : 'REPLACE COMP GENERIC',
\ 'Rv' : 'V REPLACE',
\ 'Rx' : 'REPLACE COMP',
\ 'c' : 'COMMAND',
\ 'cv' : 'VIM EX',
\ 'ce' : 'EX',
\ 'r' : 'PROMPT',
\ 'rm' : 'MORE PROMPT',
\ 'r?' : 'CONFIRM',
\ '!' : 'SHELL',
\ 't' : 'TERMINAL',
\ 'multi' : 'MULTI',
\ }, 'keep')
" NB: no*, cv, ce, r? and ! do not actually display
else
" Exception: The control character in ^S and ^V modes' codes
" break the status line if allowed to render 'naturally' so
" they are overridden with ^ (when g:airline_mode_map_codes = 1)
call extend(g:airline_mode_map, {
\ '' : '^V',
\ '' : '^S',
\ }, 'keep')
endif
call s:check_defined('g:airline_theme_map', {})
call extend(g:airline_theme_map, {