context-based auto-suggestions #66
The bit of code responsible for fetching a suggestion is here.
You should be able to play around for now by overriding the _zsh_autosuggest_suggestion function somewhere in your .zshrc after sourcing the plugin.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For commands like
cd,vim, etc. the suggestion based on history alone is not always applicable/relevant in a given context (for example, if I justcded to a given directory, the latestcdin my history is no longer useful, relativecdcommands are also not relevant if the path is not visible from the current directory). It may be nice to perform a check if this command is relevant based on $PWD, or allow users a way to define their own filters for relevant commands. I understand that this will not be possible for exotic commands and user scripts, but doesn't seem like it would be hard to do for common system tools (zsh already does this for its tab completion). Allowing the users to easily setup their own macros for this, on the other hand, could allow them to create more relevant filters for their own use cases (like ssh tab completion based on /etc/hosts).