From 904649c5c5a925b0be89d4700ce1c6db49380478 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 23 Sep 2024 14:28:04 +0200 Subject: [PATCH] Bind ctrl-backspace to backward-kill-word Closes #10741 --- CHANGELOG.rst | 4 +++- share/functions/fish_default_key_bindings.fish | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 44a0be74b..d0571b51a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -175,7 +175,9 @@ New or improved bindings - :kbd:`alt-d` on an empty command line lists the directory history again. This restores the behavior of version 2.1. - ``history-prefix-search-{backward,forward}`` now maintain the cursor position instead of moving the cursor to the end of the command line (:issue:`10430`). - The :kbd:`E` binding in vi mode now correctly handles the last character of the word, by jumping to the next word (:issue:`9700`). -- If the terminal supports shifted key codes from the `kitty keyboard protocol `_, :kbd:`shift-enter` now inserts a newline instead of executing the command line. +- The following keys have refined behavior if the terminal supports `disambiguating them `_: + - :kbd:`shift-enter` now inserts a newline instead of executing the command line. + - :kbd:`ctrl-backspace` now deletes the last word instead of only one character. - New special input functions ``forward-char-passive`` and ``backward-char-passive`` are like their non-passive variants but do not accept autosuggestions or move focus in the completion pager (:issue:`10398`). - Vi mode has seen some improvements but continues to suffer from the lack of people working on it. - Insert-mode :kbd:`ctrl-n` accepts autosuggestions (:issue:`10339`). diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index c6378ba6b..9b369d1aa 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -75,6 +75,7 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv alt-c capitalize-word bind --preset $argv alt-backspace backward-kill-word + bind --preset $argv ctrl-backspace backward-kill-word bind --preset $argv alt-b backward-word bind --preset $argv alt-f forward-word if test "$TERM_PROGRAM" = Apple_Terminal