context-based auto-suggestions #66

Closed
atsepkov opened this Issue Jun 11, 2015 · 2 comments

3 participants

@atsepkov

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 just cded to a given directory, the latest cd in my history is no longer useful, relative cd commands 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).

@stjohnjohnson

👍 🐑

@ericfreese
zsh-users member

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.

@ericfreese ericfreese closed this Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment