From 8bbb06bf5c9efb6d3e27c35af8d88e5f83987260 Mon Sep 17 00:00:00 2001 From: Xirui Zhao <35286069+xiruizhao@users.noreply.github.com> Date: Thu, 8 Apr 2021 00:06:15 +0800 Subject: [PATCH] vi mode: bind u/C-r to undo/redo in place of history search (#7908) --- CHANGELOG.rst | 1 + share/functions/fish_vi_key_bindings.fish | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cf20c5862..1c0656349 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -40,6 +40,7 @@ Interactive improvements New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ - Pasting in Vi mode puts text in the right place in normal mode (:issue:`7847`). +- Vi mode's ``u`` is bound to ``undo`` instead of ``history-search-backward``, following GNU readline's behavior. Similarly, ``C-r`` is bound to ``redo`` instead of ``history-search-backward``, following Vim (#7908). Improved prompts ^^^^^^^^^^^^^^^^ diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 5a93b5d00..6835a1173 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -101,8 +101,8 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind -s --preset $key beginning-of-line end - bind -s --preset u history-search-backward - bind -s --preset \cr history-search-forward + bind -s --preset u undo + bind -s --preset \cr redo bind -s --preset [ history-token-search-backward bind -s --preset ] history-token-search-forward