Skip to content

Instantly share code, notes, and snippets.

Last active February 20, 2019 04:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
FISH shell VI keybindings with ctrl-<arrow> word navigation
  1. enable VI mode
  2. restore the word navigation keys I'm used to in insert mode
    cat << EOF > ~/.config/fish/functions/
    function fish_user_key_bindings
      bind -M insert \e\[1\;5C nextd-or-forward-word   # ctrl-right
      bind -M insert \e\[1\;5D prevd-or-backward-word  # ctrl-left
      bind -M insert \cK kill-line  # bring back emacs style <C-k> in insert mode

Thanks to for how to get the keys to be bound on terminal startup.

Thanks to for some useful tips on finding keycodes.

fish_key_reader is a useful tool to figure out a key sequence.

You can use

sed -n l dump the escape codes when you press keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment