diff --git a/CHANGELOG.rst b/CHANGELOG.rst index de727c9b6..4279a181f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -125,6 +125,7 @@ New or improved bindings - Multiline commands are indented before being sent to the editor, which matches the rendering in fish. - ``backward-kill-path-component`` and friends now treat ``#`` as part of a path component (:issue:`10271`). - Bindings like :kbd:`alt-l` that print output in between prompts now work correctly with multiline commandlines. +- ``alt-d`` on an empty command line lists the directory history again. This restores the behavior of version 2.1. - `history-prefix-search-{backward,forward}` now maintain the cursor position instead of moving the cursor to the end of the command line (:issue:`10430`). - The ``E`` binding in vi mode now correctly handles the last character of the word, by jumping to the next word (:issue:`9700`). - If the terminal supports shifted key codes from the [kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/), ``shift-enter`` now inserts a newline instead of executing the command line. diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index e6042253c..9c33c061c 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -85,7 +85,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv end end-of-line bind --preset $argv home beginning-of-line - bind --preset $argv alt-d 'set -l cmd (commandline); if test -z "$cmd"; echo; dirh; commandline -f repaint; else; commandline -f kill-word; end' + bind --preset $argv alt-d 'if test "$(commandline)." = .; __fish_echo dirh; else; commandline -f kill-word; end' bind --preset $argv ctrl-d delete-or-exit bind --preset $argv alt-s 'for cmd in sudo doas please; if command -q $cmd; fish_commandline_prepend $cmd; break; end; end' diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index d3a6ca962..67aea33ab 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -77,8 +77,6 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv alt-\< beginning-of-buffer bind --preset $argv alt-\> end-of-buffer - bind --preset $argv alt-d kill-word - bind --preset $argv ctrl-r history-pager # term-specific special bindings