From 1e7a4b076db4bc9d77559f543c3cf0717d35009c Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 11 Oct 2022 17:46:44 +0200 Subject: [PATCH] vi-mode: Bind "/" to history-pager This is unused currently, so we can just use it here. Ctrl-s as the inverse stays because that's shared. Fixes #2271 --- doc_src/interactive.rst | 2 ++ share/functions/fish_vi_key_bindings.fish | 1 + 2 files changed, 3 insertions(+) diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 45d698a22..7fb0516c8 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -442,6 +442,8 @@ Command mode is also known as normal mode. - :kbd:`[` and :kbd:`]` search the command history for the previous/next token containing the token under the cursor before the search was started. See the :ref:`history ` section for more information on history searching. +- :kbd:`/` opens the history in a pager. This will show history entries matching the search, a few at a time. Pressing it again will search older entries, pressing :kbd:`Control`\ +\ :kbd:`S` (that otherwise toggles pager search) will go to newer entries. The search bar will always be selected. + - :kbd:`Backspace` moves the cursor left. .. _vi-mode-insert: diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index fb6c89ca1..8987e0fa5 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -88,6 +88,7 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' bind -s --preset [ history-token-search-backward bind -s --preset ] history-token-search-forward + bind -s --preset / history-pager bind -s --preset k up-or-search bind -s --preset j down-or-search