Improve documentation for configuring highlight style

Supersedes PR #430 and gives additional info.

https://stackoverflow.com/questions/47310537/how-to-change-zsh-autosuggestions-color
This commit is contained in:
Eric Freese 2019-05-27 14:56:19 -06:00
parent e9d8231ba7
commit b714f6667c

View file

@ -34,7 +34,15 @@ You may want to override the default global config variables. Default values of
### Suggestion Highlight Style ### Suggestion Highlight Style
Set `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` to configure the style that the suggestion is shown with. The default is `fg=8`. Set `ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE` to configure the style that the suggestion is shown with. The default is `fg=8`, which will set the foreground color to color 8 from the 256-color palette. If your terminal only supports 8 colors, you will need to use a number between 0 and 7.
Background color can also be set, and the suggestion can be styled bold, underlined, or standout. For example, this would show suggestions with bold, underlined, pink text on a cyan background:
```sh
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff00ff,bg=cyan,bold,underline"
```
For more info, read the Character Highlighting section of the zsh manual: `man zshzle` or [online](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting).
### Suggestion Strategy ### Suggestion Strategy