From 7122209f25cf4b99000a175829b32cd16369bdad Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Wed, 6 Oct 2021 19:24:36 -0700 Subject: [PATCH] Remove old OS X stuff from keybindings We don't support older than 10.10 anymore. fish_key_reader reports the hardcoded bind we had for Mavericks is just -k sdc. --- share/functions/fish_default_key_bindings.fish | 2 +- share/functions/fish_vi_key_bindings.fish | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 2d4195c4b..ff7b333eb 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -69,7 +69,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis bind --preset $argv -k home beginning-of-line bind --preset $argv -k end end-of-line - bind --preset $argv \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete + bind --preset $argv -k sdc backward-delete-char # shifted delete bind --preset $argv \ca beginning-of-line bind --preset $argv \ce end-of-line diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 495feabdf..914d47e33 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -118,12 +118,11 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind -s --preset e forward-single-char forward-word backward-char bind -s --preset E forward-bigword backward-char - # OS X SnowLeopard doesn't have these keys. Don't show an annoying error message. # Vi/Vim doesn't support these keys in insert mode but that seems silly so we do so anyway. - bind -s --preset -M insert -k home beginning-of-line 2>/dev/null - bind -s --preset -M default -k home beginning-of-line 2>/dev/null - bind -s --preset -M insert -k end end-of-line 2>/dev/null - bind -s --preset -M default -k end end-of-line 2>/dev/null + bind -s --preset -M insert -k home beginning-of-line + bind -s --preset -M default -k home beginning-of-line + bind -s --preset -M insert -k end end-of-line + bind -s --preset -M default -k end end-of-line # Vi moves the cursor back if, after deleting, it is at EOL. # To emulate that, move forward, then backward, which will be a NOP @@ -140,8 +139,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind -s --preset -M default \ch backward-char bind -s --preset -M insert \x7f backward-delete-char bind -s --preset -M default \x7f backward-char - bind -s --preset -M insert \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete - bind -s --preset -M default \e\[3\;2~ backward-delete-char # Mavericks Terminal.app shift-ctrl-delete + bind -s --preset -M insert -k sdc backward-delete-char # shifted delete + bind -s --preset -M default -k sdc backward-delete-char # shifted delete bind -s --preset dd kill-whole-line bind -s --preset D kill-line