Closed
Description
I'm not having success with ZSH_HIGHLIGHT_REGEXP keys that include \s
, \b
, \n
, or \w
. I haven't tried other anchors or character classes. I have tried escaping the \
as \\
with no success.
For example following https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/regexp.md:
typeset -A ZSH_HIGHLIGHT_REGEXP
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main regexp)
ZSH_HIGHLIGHT_REGEXP+=('\bmytest\b' fg=blue)
mytest
never highlights.
My goal is two matches: words that are the single word in a no-trailing-whitespace buffer
ZSH_HIGHLIGHT_REGEXP+=('^[\s\n]*(one|two)$' fg=blue)
and words that are the last in a no-trailing-whitespace buffer
ZSH_HIGHLIGHT_REGEXP+=('\b(three|four)$' fg=red)
Metadata
Metadata
Assignees
Labels
No labels