zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.55k stars 1.32k forks source link

cd tab completion not highlighting the suggestion #865

Closed Norfeldt closed 2 years ago

Norfeldt commented 2 years ago

Been struggling some time now and can't seem to figure out why I can't get the tab completion to highlight the folders I 'tab' into

Screenshot 2022-03-09 at 09 14 09

My zshrc files looks like this

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet

# Path to your oh-my-zsh installation.
export ZSH="/Users/norfeldt/.oh-my-zsh"

DISABLE_UPDATE_PROMPT="true" # Uncomment the following line to automatically update without prompting.
export UPDATE_ZSH_DAYS=13

setopt autocd
autoload -U compinit
compinit

# History (Heather setup)
if [ -z "$HISTFILE" ]; then
  HISTFILE=$HOME/.zsh_history
fi

HISTSIZE=1000
SAVEHIST=1000

setopt EXTENDED_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_BEEP

source ~/.oh-my-zsh/plugins/git/git.plugin.zsh
source ~/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
source ~/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green,underline'

[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh

# Plugins
plugins=(
  git
  autojump
  command-not-found
  zsh-autosuggestions
  zsh-syntax-highlighting
  history
)

any help would be highly appreciated 🙏 thx!

phy1729 commented 2 years ago

zsh-syntax-highlighting only deals with the command line itself. If you want to highlight the completion suggestions below, you would need to configure the completion system (e.g. zstyle ':completion:*' list-colors '') documented in man zshcompsys or https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-list_002dcolors_002c-completion-style

Norfeldt commented 2 years ago

Thanks @phy1729 - found this to do the trick

zstyle ':completion:*' menu select