Just pulled and added to ~/.zshrc, not seeing any autosuggestions at all. Tried removing all other plugins, still no dice?
Have you followed closely the instructions from the readme?
Yes.
Can you get it working by manually sourcing it?
source path/to/zsh-autosuggestions.zsh
Tried that too.
Crazy idea, I found your issue, thinking I had the same problem using antigen. However in my case it least it was just the themeing of my ZSH causing the text of the suggestion to appear in the same color as the background. If you execute echo 'hello' followed by ech and the right arrow key, does the completion work? If it does, run ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' in your shell. The completion should display properly. You can try changing the number as well to see what fits in best with your shell. Then this can be added to ~/.zshrc to make the change permanent.
Amazing! Thank you!
Glad that did it. Enjoy your autosuggestions.
Is there a way for autosuggestions to detect if the background color is the same and auto-switch to fg=6 as a workaround?
A single line in the readme warning of this should suffice. Or having the default an obnoxious colour with instruction to customise after install.
@fallenpixel thanks that ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' works perfectly for my iTerm2. somehow it doesn't need that to be worked on Terminal.app
@fallenpixel You sir, are a life saver!
@fallenpixel thank you so much for posting your finding! It drives me crazy for the past couple hours.
Follow your lead, I find out that the issue is coming particular from iTerm2, (while the Mac Terminal is unaffected as @solomonxie point out). Also, in my case, setting ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE to anything higher than 7 would not work. That leads me to discover that somehow my color profile is set to Terminal xterm instead of xterm-256color. The setting is at Profiles -> [Profile Name] -> Terminal -> Report terminal type.
So, at default ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=8 cause xterm to unable to render the color, thus render it as default frontground text. You can either change it to lower value, or change terminal type to xterm-256color to render more color.
@fallenpixel thank you so much for posting your finding! It drives me crazy for the past couple hours.
Follow your lead, I find out that the issue is coming particular from iTerm2, (while the Mac Terminal is unaffected as @solomonxie point out). Also, in my case, setting
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLEto anything higher than 7 would not work. That leads me to discover that somehow my color profile is set to Terminalxterminstead ofxterm-256color. The setting is at Profiles -> [Profile Name] -> Terminal -> Report terminal type.So, at default
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=8causextermto unable to render the color, thus render it as default frontground text. You can either change it to lower value, or change terminal type toxterm-256colorto render more color.
This fixed my problem, thank you!
I did not check all answers, in case nobody noticed.
You should put it before soruce omz , like:
plugins=(git)
plugins=(zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
Most helpful comment
Crazy idea, I found your issue, thinking I had the same problem using antigen. However in my case it least it was just the themeing of my ZSH causing the text of the suggestion to appear in the same color as the background. If you execute
echo 'hello'followed byechand the right arrow key, does the completion work? If it does, runZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6'in your shell. The completion should display properly. You can try changing the number as well to see what fits in best with your shell. Then this can be added to~/.zshrcto make the change permanent.