Implementing user mode - mawww/kakoune GitHub Wiki

Kakoune provides a simple way to bind keys to a personal namespace, the user mode which is triggered by the <space> by default.

map global user e ':echo foo<ret>'

If the user keymode is not big enough, you can implement your own, triggered by the key you want. Good candidates can be <a-g> or <a-v> since g and v already work quite the same.

Start by declaring a new mode:

declare-user-mode cmd

add some bindings on it:

map global cmd w ':write<esc>'
map global cmd e ':e<space>'

and finally bind a key to trigger this custom mode:

map global normal <a-,> ':enter-user-mode<space>cmd<ret>'
⚠️ **GitHub.com Fallback** ⚠️