Remove obsolete Vi mode delete key workaround

As reported in
https://matrix.to/#/!YLTeaulxSDauOOxBoR:matrix.org/$n20_uqiMqatEQcPG79Ca0c2_YvHBHTr-yCVXTEuze_Y

commit f5fac096c0 (Don't move cursor in delete-char, 2017-04-19) fixed the
behavior of Vi mode keys "delete" and "x" when the cursor is at the end of
the buffer, and commit d51f669647 (Vi mode: avoid placing cursor beyond
last character, 2024-02-14) generalized this fix.

This means that the delete-specific fix is no longer necessary. Remove it.

Note that if the cursor is at end of a line but not the last line, the
behavior of "delete" in Vi mode is still wrong.  It should stay on the line.
This commit is contained in:
Johannes Altmanninger
2025-05-02 05:35:42 +02:00
parent e3517f69b3
commit 1ff8f983c4

View File

@@ -113,13 +113,10 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish'
bind -s --preset -M insert end end-of-line
bind -s --preset -M default end end-of-line
# Vi moves the cursor back if, after deleting, it is at EOL.
# To emulate that, move forward, then backward, which will be a NOP
# if there is something to move forward to.
bind -s --preset -M default x delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
bind -s --preset -M default x delete-char
bind -s --preset -M default X backward-delete-char
bind -s --preset -M insert delete delete-char forward-single-char backward-char
bind -s --preset -M default delete delete-char 'set fish_cursor_end_mode exclusive' forward-single-char backward-char 'set fish_cursor_end_mode inclusive'
bind -s --preset -M insert delete delete-char
bind -s --preset -M default delete delete-char
# Backspace deletes a char in insert mode, but not in normal/default mode.
bind -s --preset -M insert backspace backward-delete-char