Skip to content

Instantly share code, notes, and snippets.

@Screwtapello
Created June 18, 2018 09:09
Show Gist options
  • Save Screwtapello/bed4aa067877b6afe76630e90bb1720a to your computer and use it in GitHub Desktop.
Save Screwtapello/bed4aa067877b6afe76630e90bb1720a to your computer and use it in GitHub Desktop.
# Readline has a bunch of special-case bindings just for vi mode, which means we
# can't just add Kakoune-style bindings; instead, we must build Kakoune-style
# bindings from combinations of other (usually emacs-based) commands. BUT
# Readline doesn't support binding a key to a sequence of commands; instead,
# we bind commands to a likely-unused portion of the keymap, and then bind
# our actual keys to sequences of those unusual keys.
"\C-a\C-xm": set-mark
"\C-a\C-xh": backward-char
"\C-a\C-xl": forward-char
"\C-a\C-xw": forward-word
"\C-a\C-xb": backward-word
"\C-a\C-x0": beginning-of-line
"\C-a\C-x$": end-of-line
"h": "\C-a\C-xm\C-a\C-xh"
"H": "\C-a\C-xh"
"l": "\C-a\C-xm\C-a\C-xl"
"L": "\C-a\C-xl"
"w": "\C-a\C-xm\C-a\C-xw"
"W": "\C-a\C-xw"
"b": "\C-a\C-xm\C-a\C-xb"
"B": "\C-a\C-xb"
"x": "\C-a\C-x0\C-a\C-xm\C-a\C-x$"
";": "\C-a\C-xm"
"d": kill-region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment