From 1d98846e0370dfbdd12343ad2b471fa5c19f516e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 13 Apr 2024 09:28:35 +0200 Subject: [PATCH] Remove some redundant raw bindings We already decode these, see parse_csi() and parse_ss3(). --- .../functions/__fish_shared_key_bindings.fish | 25 ------------------- .../functions/fish_default_key_bindings.fish | 14 ----------- 2 files changed, 39 deletions(-) diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 8ed0c16d8..f0de8b56f 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -19,17 +19,10 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv left backward-char $legacy_bind --preset $argv -k right forward-char $legacy_bind --preset $argv -k left backward-char - $legacy_bind --preset $argv \e\[C forward-char - $legacy_bind --preset $argv \e\[D backward-char - # Some terminals output these when they're in in keypad mode. - $legacy_bind --preset $argv \eOC forward-char - $legacy_bind --preset $argv \eOD backward-char # Ctrl-left/right - these also work in vim. bind --preset $argv ctrl-right forward-word bind --preset $argv ctrl-left backward-word - $legacy_bind --preset $argv \e\[1\;5C forward-word - $legacy_bind --preset $argv \e\[1\;5D backward-word bind --preset $argv pageup beginning-of-history bind --preset $argv pagedown end-of-history @@ -55,10 +48,6 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod $legacy_bind --preset $argv -k down down-or-search bind --preset $argv up up-or-search $legacy_bind --preset $argv -k up up-or-search - $legacy_bind --preset $argv \e\[A up-or-search - $legacy_bind --preset $argv \e\[B down-or-search - $legacy_bind --preset $argv \eOA up-or-search - $legacy_bind --preset $argv \eOB down-or-search bind --preset $argv shift-right forward-bigword bind --preset $argv shift-left backward-bigword @@ -71,12 +60,6 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod $legacy_bind --preset $argv \e\eOD prevd-or-backward-word $legacy_bind --preset $argv \e\e\[C nextd-or-forward-word $legacy_bind --preset $argv \e\e\[D prevd-or-backward-word - $legacy_bind --preset $argv \eO3C nextd-or-forward-word - $legacy_bind --preset $argv \eO3D prevd-or-backward-word - $legacy_bind --preset $argv \e\[3C nextd-or-forward-word - $legacy_bind --preset $argv \e\[3D prevd-or-backward-word - $legacy_bind --preset $argv \e\[1\;3C nextd-or-forward-word - $legacy_bind --preset $argv \e\[1\;3D prevd-or-backward-word $legacy_bind --preset $argv \e\[1\;9C nextd-or-forward-word #iTerm2 $legacy_bind --preset $argv \e\[1\;9D prevd-or-backward-word #iTerm2 @@ -86,12 +69,6 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod $legacy_bind --preset $argv \e\eOB history-token-search-forward $legacy_bind --preset $argv \e\e\[A history-token-search-backward $legacy_bind --preset $argv \e\e\[B history-token-search-forward - $legacy_bind --preset $argv \eO3A history-token-search-backward - $legacy_bind --preset $argv \eO3B history-token-search-forward - $legacy_bind --preset $argv \e\[3A history-token-search-backward - $legacy_bind --preset $argv \e\[3B history-token-search-forward - $legacy_bind --preset $argv \e\[1\;3A history-token-search-backward - $legacy_bind --preset $argv \e\[1\;3B history-token-search-forward $legacy_bind --preset $argv \e\[1\;9A history-token-search-backward # iTerm2 $legacy_bind --preset $argv \e\[1\;9B history-token-search-forward # iTerm2 # Bash compatibility @@ -106,9 +83,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv ctrl-u backward-kill-line bind --preset $argv ctrl-w backward-kill-path-component bind --preset $argv end end-of-line - $legacy_bind --preset $argv \e\[F end-of-line bind --preset $argv home beginning-of-line - $legacy_bind --preset $argv \e\[H beginning-of-line bind --preset $argv alt-d 'set -l cmd (commandline); if test -z "$cmd"; echo; dirh; commandline -f repaint; else; commandline -f kill-word; end' bind --preset $argv ctrl-d delete-or-exit diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 45aed532c..d3a6ca962 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -35,10 +35,6 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv right forward-char bind --preset $argv left backward-char - $legacy_bind --preset $argv \eOC forward-char - $legacy_bind --preset $argv \eOD backward-char - $legacy_bind --preset $argv \e\[C forward-char - $legacy_bind --preset $argv \e\[D backward-char $legacy_bind --preset $argv -k right forward-char $legacy_bind --preset $argv -k left backward-char @@ -46,12 +42,6 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv backspace backward-delete-char bind --preset $argv shift-backspace backward-delete-char - # for PuTTY - # https://github.com/fish-shell/fish-shell/issues/180 - $legacy_bind --preset $argv \e\[1~ beginning-of-line - $legacy_bind --preset $argv \e\[3~ delete-char - $legacy_bind --preset $argv \e\[4~ end-of-line - bind --preset $argv home beginning-of-line $legacy_bind --preset $argv -k home beginning-of-line bind --preset $argv end end-of-line @@ -99,10 +89,6 @@ function fish_default_key_bindings -d "emacs-like key binds" # This is a workaround, there will be additions in he future. $legacy_bind --preset $argv \e\[P delete-char $legacy_bind --preset $argv \e\[Z up-line - case 'rxvt*' - $legacy_bind --preset $argv \e\[8~ end-of-line - $legacy_bind --preset $argv \eOc forward-word - $legacy_bind --preset $argv \eOd backward-word case xterm-256color # Microsoft's conemu uses xterm-256color plus # the following to tell a console to paste: