From f19ff894323c2172b430a7c249a5bc586ce5fb13 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 20 Aug 2018 16:49:39 -0700 Subject: [PATCH] Add instructions about initializing variable Many users use modular configuration loaders for zshrc. Adding a note to users explaining how to define ZSH_HIGHLIGHT_PATTERNS before sourcing zsh-syntax-highlighting. The typeset is important, since simply setting the variable doesn't have the desired effect. --- docs/highlighters/pattern.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/highlighters/pattern.md b/docs/highlighters/pattern.md index 3ad5f24..173b9eb 100644 --- a/docs/highlighters/pattern.md +++ b/docs/highlighters/pattern.md @@ -14,6 +14,8 @@ To use this highlighter, associate patterns with styles in the The syntax for values is the same as the syntax of "types of highlighting" of the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)` -manual page][zshzle-Character-Highlighting]. +manual page][zshzle-Character-Highlighting]. Note: if you would like to define this +variable before you source zsh-syntax-highlighting, you will need to declare it first with: +`typeset -gA ZSH_HIGHLIGHT_PATTERNS`. [zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting