Closed onnyyonn closed 2 years ago
Hi thanks for the issue! It's different from #20 — what you want is sort of the opposite of what that user wanted.
zsh-autosuggestions suggests history items and commands. By definition abbreviations aren't commands, so that's out. You could add them to your history:
history
or match_prev_cmd
strategy (see https://github.com/zsh-users/zsh-autosuggestions#suggestion-strategy)echo $HISTFILE
. if there isn't one, add [ -z "$HISTFILE" ] && HISTFILE="~/.zsh_history"
to your .zshrc
(use any path you like, but know that ~/.zsh_history
is a standard choice)), then add your abbreviations to it:
abbr list-abbreviations -U >> $HISTFILE
But that's not a real solution, because as you run other commands the abbreviation history entries could be deprioritized.
What you really need is for zsh-autosuggestions to support passing in a custom list of terms which would match before anything else. Pretty niche need but you could request the feature over at zsh-autosuggestions.
Closing because the change currently necessary is not to zsh-abbr, but do please let me know if you get this working!
Autosuggestion for abbreviations doesn't work. #20 suggests that it's intentional. But there are some use cases, where it can be useful. Is there any chance it will be implemented?