nvim-libmodal/examples/keymaps-submode.vim
Iron-E 49a02ad692
merge!: cleanup the plugin
This was my first plugin. Looking back on it, it was full of bad
design decisions (and I have elected to keep most of the user-facing
ones for backwards-compatability). This merge tries to uncrustify the
plugin by standardizing the documentation, removing much unecessary
code, reorganizing the internal structures, and removing references to
my own made-up terminology.
2022-04-25 17:59:33 -04:00

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'