ZSH autosuggestions: How to customize?

I want to customize the green text which appears below. I’ve read online that i need to edit the configuration of zsh-autosuggestions but I’m unable to find any configuration file which contains ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE. Can someone point me towards the right direction?
Screenshot from 2022-07-15 22-34-26

Add it then. Into .zshrc.

Just curious, if you were to edit ‘/usr/share/zsh/manjaro-zsh-config’ that would be a system wide change just not for the current user, right? Is there any downside to editing those files?

You don’t edit files in /usr/share. They will be overwritten on next update.

1 Like

I think this question means you don’t understand how it works at all…

For example, my suggestions are in grey… and here you can see which terminal colour is being used - however, you can specify your own.

We search internet and find the ZSH Autosuggestions.

So to get Autosuggestions, we can do this:

git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions

Then all you need is a line in zshrc…
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff00ff,bg=cyan,bold,underline

Then reload your shell, and you’ll have a rather horribly garish autosuggest - so go back and edit to suit, or comment out to revert.

As I like GRUVBOX colours, I had a stab at this and ended up with this line:
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#50493e,bold"

It looks like this:

Without the line, it uses a colour from the pallette (as you can see from ‘fastfetch’)

Sure, you should use those files as a reference. When configuration files are installed, you should copy them…

You can try copying it like this:
cp /usr/share/zsh/manjaro-zsh-config ~/.zshrc-manjaro

Then you can edit that file, copy from it, or just compare that to your .zshrc with meld .zshrc .zshrc-manjaro

Then you’ll see the good stuff that those Manjaro Devs just didn’t put in :wink:
like this:

#-------- Global Alias {{{
globalias() {
  if [[ $LBUFFER =~ '[a-zA-Z0-9]+$' ]]; then
    zle _expand_alias
    zle expand-word
  fi
  zle self-insert
}
zle -N globalias
bindkey " " globalias                 # space key to expand globalalias
# bindkey "^ " magic-space            # control-space to bypass completion
bindkey "^[[Z" magic-space            # shift-tab to bypass completion
bindkey -M isearch " " magic-space    # normal space during searches

#}}}

Sorry for the late reply, I did mess up my configuration as you said! I was lucky because I made a backup of the original config files.I was able to change the color by changing the colour pallette. Thanks for the help I appreciate it!
Screenshot from 2022-07-18 12-53-08

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.