bindings: expand abbreviations with all end-of-command characters

Closes #6970.
This commit is contained in:
David Adam 2020-05-07 09:13:33 +08:00
parent ad020e84dd
commit ec74c739c8

View file

@ -31,8 +31,15 @@ function fish_default_key_bindings -d "Default (Emacs-like) key bindings for fis
bind --preset $argv "" self-insert bind --preset $argv "" self-insert
or exit # protect against invalid $argv or exit # protect against invalid $argv
# Space expands abbrs _and_ inserts itself. # Space and other command terminators expands abbrs _and_ inserts itself.
bind --preset $argv " " self-insert expand-abbr bind --preset $argv " " self-insert expand-abbr
bind --preset $argv ";" self-insert expand-abbr
bind --preset $argv "|" self-insert expand-abbr
bind --preset $argv "&" self-insert expand-abbr
bind --preset $argv "^" self-insert expand-abbr
bind --preset $argv ">" self-insert expand-abbr
bind --preset $argv "<" self-insert expand-abbr
# Closing a command substitution expands abbreviations
bind --preset $argv ")" self-insert expand-abbr bind --preset $argv ")" self-insert expand-abbr
# Ctrl-space inserts space without expanding abbrs # Ctrl-space inserts space without expanding abbrs
bind -k nul 'commandline -i " "' bind -k nul 'commandline -i " "'