You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim-libmodal/examples/keymaps-submode.vim

19 lines
526 B
VimL

" Recurse counter.
let s:barModeRecurse = 0
" Register 'z' as the map for recursing further (by calling the BarMode function again).
let s:barModeKeymaps = {
\ 'z': 'BarModeEnter',
\}
" define the BarMode() function which is called whenever the user presses 'z'
function! s:BarMode()
let s:barModeRecurse += 1
call libmodal#Enter('BAR' . s:barModeRecurse, s:barModeKeymaps)
let s:barModeRecurse -= 1
endfunction
" Call BarMode() initially to begin the demo.
command! BarModeEnter call s:BarMode()
execute 'BarModeEnter'