zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.57k stars 1.88k forks source link

Define symbols to be ignored on completion #520

Open mitinarseny opened 4 years ago

mitinarseny commented 4 years ago

It would be useful to provide a feature when I am not at the end of the line and to the right of cursor there are some symbols that can be ignored when suggesting a command.

For example, when I type git cm i have following suggestion image

But when I press " autopair plugin inserts a send ", so the completion is gone... image Then I start to type feat(nvim): and it would be useful to define ZSH_AUTOSUGGEST_IGNORE_SYMBOLS as following:

ZSH_AUTOSUGGEST_IGNORE_SYMBOLS="'\"})"

to make it possible to show completions even if any count of any of these symbols are now on the right of cursor.

Same issue can be with $(...): image image

Is it possible to implement?

ericfreese commented 4 years ago

It seems possible but I'm curious about how things would function when in that state of having both an ignored suffix of the command and a suggestion to show. Can you elaborate on how the suggestion would be shown in your second and fourth screenshots? And what you think should happen if you were to press enter from those states without accepting the suggestion?

mitinarseny commented 4 years ago

Hmm, that's an interesting question :) To be honest, I can't come up with a solution. Sorry, I didn't think of that when was opening this issue.