From 0abcf9265efe5eb43e9992133638356f0f9c5c09 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Thu, 7 Feb 2019 12:37:05 -0800 Subject: [PATCH] {forward,backward}-bigword on Shift-Left/Right There was no way to do this at all without vi keybindings, and it turns out shift-left/shift-right was available. Fixes #1605 --- doc_src/index.hdr.in | 4 +++- share/functions/__fish_shared_key_bindings.fish | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index d3be1e5d2..de4cd4ec8 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -1097,7 +1097,9 @@ Some bindings are shared between emacs- and vi-mode because they aren't text edi - @key{Tab} completes the current token. @key{Shift, Tab} completes the current token and starts the pager's search mode. -- @key{Alt,←,Left} and @key{Alt,→,Right} move the cursor one word left or right, or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, @key{Alt,→,Right} (or @key{Alt,F}) accepts the first word in the suggestion. +- @key{Alt,←,Left} and @key{Alt,→,Right} move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, @key{Alt,→,Right} (or @key{Alt,F}) accepts the first word in the suggestion. + +- @key{Shift,←,Left} and @key{Shift,→,Right} move the cursor one word left or right, without stopping on punctuation. - @cursor_key{↑,Up} and @cursor_key{↓,Down} (or @key{Control,P} and @key{Control,N} for emacs aficionados) search the command history for the previous/next command containing the string that was specified on the commandline before the search was started. If the commandline was empty when the search started, all commands match. See the history section for more information on history searching. diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 29d7894a8..ea1fc7f08 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -45,6 +45,9 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv \eOA up-or-search bind --preset $argv \eOB down-or-search + bind --preset $argv -k sright forward-bigword + bind --preset $argv -k sleft backward-bigword + # Alt-left/Alt-right bind --preset $argv \e\eOC nextd-or-forward-word bind --preset $argv \e\eOD prevd-or-backward-word