diff --git a/doc_src/index.rst b/doc_src/index.rst index 2650d5890..288d962db 100644 --- a/doc_src/index.rst +++ b/doc_src/index.rst @@ -1575,6 +1575,8 @@ Some bindings are shared between emacs- and vi-mode because they aren't text edi - :kbd:`Control`\ +\ :kbd:`L` clears and repaints the screen. +- :kbd:`Control`\ +\ :kbd:`R` searches the history if there is something in the commandline. This is mainly to ease the transition from other shells, where ctrl+r initiates the history search. + - :kbd:`Control`\ +\ :kbd:`W` moves the previous path component (everything up to the previous "/", ":" or "@") to the `killring <#killring>`__. - :kbd:`Control`\ +\ :kbd:`X` copies the current buffer to the system's clipboard, :kbd:`Control`\ +\ :kbd:`V` inserts the clipboard contents. diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 48fc8977d..c24bfc81d 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -98,6 +98,9 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis bind --preset $argv \ed kill-word + # Let ctrl+r search history if there is something in the commandline. + bind --preset $argv \cr 'commandline | string length -q; and commandline -f history-search-backward' + # term-specific special bindings switch "$TERM" case 'rxvt*'