From 01d681067c1952c8c149c4aed8429ed07d1989c7 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sat, 21 Jan 2023 13:35:22 +0100 Subject: [PATCH] Bind ctrl-g to cancel as well Classic emacs thing and the chord is so far unused. Fixes #9484 --- doc_src/interactive.rst | 2 ++ share/functions/fish_default_key_bindings.fish | 1 + 2 files changed, 3 insertions(+) diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index c487f372c..8c9b99e13 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -363,6 +363,8 @@ To enable emacs mode, use ``fish_default_key_bindings``. This is also the defaul - :kbd:`Control`\ +\ :kbd:`K` deletes from the cursor to the end of line (moving it to the :ref:`killring`). +- :kbd:`Escape` and :kbd:`Control`\ +\ :kbd:`G` cancel the current operation. Immediately after an unambiguous completion this undoes it. + - :kbd:`Alt`\ +\ :kbd:`C` capitalizes the current word. - :kbd:`Alt`\ +\ :kbd:`U` makes the current word uppercase. diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 95d5e7a4d..4875700f0 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -61,6 +61,7 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv \cf forward-char bind --preset $argv \cb backward-char bind --preset $argv \ct transpose-chars + bind --preset $argv \cg cancel bind --preset $argv \c_ undo bind --preset $argv \cz undo bind --preset $argv \e/ redo