The following will add a <ret>
mapping to any existing user mode, which locks the mode itself. Reduces the pressure on mappable keys. For example
usermode-lock-add buffers
Whereas before you had “,b
” to enter buffers mode and “,B
” to keep it locked, afterwards you can use “,b
” and “,b<ret>
”. So:
def -override -params 1 usermode-lock-add %{ eval -draft %sh{
printf 'map -docstring %s -- global %s <ret> %s\n' \
'"lock mode"' "$1" "': enter-user-mode -lock $1<ret>'"
} } -shell-script-candidates %{
printf '%s\n' $kak_user_modes
} -docstring %{
Add <ret>=lock to any usermode
}