Skip to content

Implementing user mode

Alex Leferry 2 edited this page Dec 27, 2016 · 17 revisions

The common pattern to do that is to use the on-key command-line command, plus the switch statement of your shell.

def -hidden repl-mode %{ on-key %{ %sh{
  case $kak_key in
    R) echo repl ;;
    r) echo send-text ;;
  esac
}}}

Then expose the mode on a key.

map global user r :repl-mode<ret>

Clone this wiki locally