Search code examples
zshoh-my-zsh

How to change color of directory suggestions in ZSH


I am using oh-my-zsh

Problem: want to change the background color of suggested directories

How to reproduce the problem: run ls then type vim <tab> (in zsh)

Yellow background color -> to any other color
I have tried using https://geoff.greer.fm/lscolors/ to test colors but didn't work.

`

Currently have this in my .zshrc _ls_colors="di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43"
zstyle ':completion:*:default' list-colors "${(s.:.)_ls_colors}"


Solution

  • Thank you @Jairo Molina for the suggestion - this worked for me in my .zshrc:

    # remove ls highlight color
    _ls_colors=":ow=01;33" 
    zstyle ':completion:*:default' list-colors "${(s.:.)_ls_colors}"
    LS_COLORS+=$_ls_colors
    

    which renders this: enter image description here

    vs this nastiness: enter image description here

    this also works for ls whereas your above bit did not enter image description here