Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .