Restore some iTerm2 default key bindings

c0bcd817ba removed some key bindings, including the bindings of
ESC ESC [ C for Alt-Right. the commit claimed that
"Sequences like \e\eOC are Escape followed by an SS3 arrow key which we
can already decode separately." but for whatever reason this doesn't work:
Alt-Right is broken in iTerm2 by default.

Restore the default ESC ESC [ X bindings for iTerm2 compatibility.
This commit is contained in:
ridiculousfish 2024-05-19 11:01:14 -07:00
parent 42f8672f34
commit efefeda392

View File

@ -56,9 +56,13 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
bind --preset $argv alt-right nextd-or-forward-word
bind --preset $argv alt-left prevd-or-backward-word
$legacy_bind --preset $argv \e\e\[C nextd-or-forward-word # iTerm2 default
$legacy_bind --preset $argv \e\e\[D prevd-or-backward-word # iTerm2 default
bind --preset $argv alt-up history-token-search-backward
bind --preset $argv alt-down history-token-search-forward
$legacy_bind --preset $argv \e\e\[A history-token-search-backward # iTerm2 default
$legacy_bind --preset $argv \e\e\[B history-token-search-forward # iTerm2 default
# Bash compatibility
# https://github.com/fish-shell/fish-shell/issues/89
bind --preset $argv alt-. history-token-search-backward