mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
6af96a81a8
There is no natural default binding for token movements. Add the alt-{left,right,backspace,delete}, breaking some existing behavior. For example, backward-delete-word is no longer bound to alt-backspace but only to ctrl-backspace. Unfortunately some terminals (particularly tmux) don't support distinguishing ctrl-backspace from ctrl-h yet, so the loss of alt-backspace may be tragic. --- I guess we could also add: bind alt-B backward-token bind alt-F forward-token bind ctrl-W backward-kill-token bind alt-D kill-token Those might be intercepted by the terminal on Linux, but I don't know where that happens. Tested on foot, kitty, alacritty, xterm, tmux, konsole and gnome-terminal. Closes #10766
8 lines
271 B
Fish
8 lines
271 B
Fish
function prevd-or-backward-token --description "If commandline is empty, run prevd; else move one argument to the left"
|
|
if test "$(commandline; printf .)" = \n.
|
|
prevd
|
|
commandline -f repaint
|
|
return
|
|
end
|
|
commandline -f backward-token
|
|
end
|