Move ctrl-left/right forward-word to shared bindings

These also work in vim.

Fixes #6755.
This commit is contained in:
Fabian Homborg 2020-03-15 12:58:51 +01:00
parent 266ce7c940
commit 463b9b99c6
3 changed files with 7 additions and 3 deletions

View File

@ -1291,7 +1291,9 @@ Some bindings are shared between emacs- and vi-mode because they aren't text edi
- :kbd:`Alt+←,Left` and :kbd:`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, :kbd:`Alt+→,Right` (or :kbd:`Alt+F`) accepts the first word in the suggestion.
- :kbd:`Shift,←,Left` and :kbd:`Shift,→,Right` move the cursor one word left or right, without stopping on punctuation.
- :kbd:`Ctrl+←` and :kbd:`Ctrl+→` move the cursor one word left or right. These accept one word of the autosuggestion - the part they'd move over.
- :kbd:`Shift+←` and :kbd:`Shift+→` move the cursor one word left or right, without stopping on punctuation. These accept one big word of the autosuggestion.
- :kbd:`↑` (Up) and :kbd:`↓` (Down) (or :kbd:`Control+P` and :kbd:`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 <#history-search>`_ section for more information on history searching.

View File

@ -22,6 +22,10 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
bind --preset $argv \eOC forward-char
bind --preset $argv \eOD backward-char
# Ctrl-left/right - these also work in vim.
bind --preset $argv \e\[1\;5C forward-word
bind --preset $argv \e\[1\;5D backward-word
bind --preset $argv -k ppage beginning-of-history
bind --preset $argv -k npage end-of-history

View File

@ -82,8 +82,6 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind --preset $argv \e\b backward-kill-word
bind --preset $argv \eb backward-word
bind --preset $argv \ef forward-word
bind --preset $argv \e\[1\;5C forward-word
bind --preset $argv \e\[1\;5D backward-word
bind --preset $argv \e\< beginning-of-buffer
bind --preset $argv \e\> end-of-buffer