install.fairie/dotfiles/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim
Git E2E Dev Test Username 6892bd7dbd git subrepo clone https://github.com/vim-airline/vim-airline.git ./dotfiles/.vim/plugged/vim-airline
subrepo:
  subdir:   "dotfiles/.vim/plugged/vim-airline"
  merged:   "0ed7b8b"
upstream:
  origin:   "https://github.com/vim-airline/vim-airline.git"
  branch:   "master"
  commit:   "0ed7b8b"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:36:08 -04:00

31 lines
979 B
VimL

" MIT License. Copyright (c) 2013-2021 Doron Behar, C.Brabandt et al.
" vim: et ts=2 sts=2 sw=2
scriptencoding utf-8
if !has('keymap')
finish
endif
function! airline#extensions#keymap#status()
if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap'))
let short_codes = get(g:, 'airline#extensions#keymap#short_codes', {})
let label = get(g:, 'airline#extensions#keymap#label', g:airline_symbols.keymap)
let default = get(g:, 'airline#extensions#keymap#default', '')
if (label !=# '')
let label .= ' '
endif
let keymap = &keymap
if has_key(short_codes, keymap)
let keymap = short_codes[keymap]
endif
return printf('%s', (!empty(keymap) && &iminsert ? (label . keymap) :
\ (!empty(default) ? label . default : default)))
else
return ''
endif
endfunction
function! airline#extensions#keymap#init(ext)
call airline#parts#define_function('keymap', 'airline#extensions#keymap#status')
endfunction