From b714f6667c8222f4ee4a5c6925b1c797677a6400 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Mon, 27 May 2019 14:56:19 -0600 Subject: [PATCH] Improve documentation for configuring highlight style Supersedes PR #430 and gives additional info. https://stackoverflow.com/questions/47310537/how-to-change-zsh-autosuggestions-color --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1435c99..1dac45c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,15 @@ You may want to override the default global config variables. Default values of ### 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