From 20e9fe9c9515953673a6f2f79add4ec54e0214c5 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 5 Feb 2025 19:06:37 +0100 Subject: [PATCH] Revert token movement bindings Comments by macOS users have shown that, apparently, on that platform this isn't wanted. The functions are there for people to use, but we need more time to figure out if and how we're going to bind these by default. For example, we could change these bindings depending on the OS in future. This reverts most of commit 6af96a81a8c6ff5e632d4dda7448f5f01d7a5d35. Fixes #10926 See #11107 (cherry picked from commit 378f452eaa0abbe1a6e3d41963adfcee11803a09) --- doc_src/interactive.rst | 4 ++-- share/functions/__fish_shared_key_bindings.fish | 4 ++-- share/functions/fish_default_key_bindings.fish | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index bf04f397c..28bc55157 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -303,7 +303,7 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit - :kbd:`alt-enter` inserts a newline at the cursor position. This is useful to add a line to a commandline that's already complete. -- :kbd:`alt-left` (``←``) and :kbd:`alt-right` (``→``) move the cursor one argument 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, :kbd:`alt-right` (``→``) (or :kbd:`alt-f`) accepts the first argument in the suggestion. +- :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:`ctrl-left` (``←``) and :kbd:`ctrl-right` (``→``) move the cursor one word left or right. These accept one word of the autosuggestion - the part they'd move over. @@ -370,7 +370,7 @@ To enable emacs mode, use :doc:`fish_default_key_bindings ` moves to the end. diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 2677edda5..448b64441 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -54,8 +54,8 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod $legacy_bind --preset $argv -k sright forward-bigword $legacy_bind --preset $argv -k sleft backward-bigword - bind --preset $argv alt-right nextd-or-forward-token - bind --preset $argv alt-left prevd-or-backward-token + bind --preset $argv alt-right nextd-or-forward-word + bind --preset $argv alt-left prevd-or-backward-word bind --preset $argv alt-up history-token-search-backward bind --preset $argv alt-down history-token-search-forward diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 86190acff..9dadf056f 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -55,9 +55,8 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv alt-u upcase-word bind --preset $argv alt-c capitalize-word - bind --preset $argv alt-backspace backward-kill-token + bind --preset $argv alt-backspace backward-kill-word bind --preset $argv ctrl-backspace backward-kill-word - bind --preset $argv alt-delete kill-token bind --preset $argv ctrl-delete kill-word bind --preset $argv alt-b prevd-or-backward-word bind --preset $argv alt-f nextd-or-forward-word