Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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