zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.1k stars 1.86k forks source link

fish like suggestion for files/directory #739

Closed kohnish closed 1 year ago

kohnish commented 1 year ago

Is your feature request related to a problem? Please describe.

Commands that accepts a file or directory shouldn't be suggested when the argument is invalid

Describe the solution you'd like

Just like fish, only suggest the command the works. For example, cd ~/.vim can be suggested from anywhere but not cd .vim if the .vim directory doesn't exist in the pwd.

kohnish commented 1 year ago

I think the following is enough.

ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_HISTORY_IGNORE='(cd|ls|vim) *'