From 8b961a0ca8976140929f6b0299f41bf4455e993a Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 29 Jun 2020 21:31:29 +0200 Subject: [PATCH] Bind undo to Control-Z in addition to Control-/ See #7152 --- CHANGELOG.rst | 5 ++--- doc_src/index.rst | 2 +- share/functions/fish_default_key_bindings.fish | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 69397d582..8d0a98dc1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -85,9 +85,8 @@ Interactive improvements New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ -- New readline commands ``undo`` (Ctrl+_) and ``redo`` (Alt-/) can be - used to revert changes to the command line or the pager search field - (#6570). +- New readline commands ``undo`` (Ctrl+_ or Ctrl+Z) and ``redo`` (Alt-/) can be used to revert + changes to the command line or the pager search field (#6570). - New function ``__fish_preview_current_file`` (Alt+O) opens the current file at the cursor in a pager (#6838). - ``edit_command_buffer`` (Alt-E and Alt-V) passes the cursor position diff --git a/doc_src/index.rst b/doc_src/index.rst index 0019fb723..76803c0f7 100644 --- a/doc_src/index.rst +++ b/doc_src/index.rst @@ -1478,7 +1478,7 @@ Emacs mode commands - :kbd:`Alt`\ +\ :kbd:`T` transposes the last two words. -- :kbd:`Control`\ +\ :kbd:`_` (:kbd:`Control`\ +\ :kbd:`/` on some terminals) undoes the most recent edit of the line. +- :kbd:`Control`\ +\ :kbd:`Z`, :kbd:`Control`\ +\ :kbd:`_` (:kbd:`Control`\ +\ :kbd:`/` on some terminals) undo the most recent edit of the line. - :kbd:`Alt`\ +\ :kbd:`/` reverts the most recent undo. diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 7b1c518aa..48fc8977d 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -80,6 +80,7 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis bind --preset $argv \cb backward-char bind --preset $argv \ct transpose-chars bind --preset $argv \c_ undo + bind --preset $argv \cz undo bind --preset $argv \e/ redo bind --preset $argv \et transpose-words bind --preset $argv \eu upcase-word