I am currently using zle_highlight in zsh to highlight the entire command line. However, I also hope I could highlight "|" using a different more discerning style.

After googling for a while, I found no solution. Could anyone help?

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

You can't do that with just zle_highlight. It controls the appearance of UI elements (e.g. the region, or the incremental search text), not of normal text.

You can do this with the experimental zsh syntax highlighting plugin. By default, it highlights keywords and command names, which may be enough. To highlight |, try something like

ZSH_HIGHLIGHT_HIGHLIGHTERS+=(pattern)
ZSH_HIGHLIGHT_PATTERNS+=('\|' fg=magenta,bold)

but note that this highlights all | characters everywhere, not just the ones that are pipes.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.