From ded1c8789b07155c833fc49abbb422b93233e81c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 24 Nov 2015 07:27:29 +0000 Subject: [PATCH] docs: Clarify highlighters documentation. --- docs/highlighters.md | 13 ++++++++++--- docs/highlighters/pattern.md | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/highlighters.md b/docs/highlighters.md index 4c6b950..a614b1c 100644 --- a/docs/highlighters.md +++ b/docs/highlighters.md @@ -23,9 +23,16 @@ To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in How to tweak highlighters ------------------------- -Highlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` array. -Navigate into each highlighter directory to see what styles it defines -and how to configure it. +Highlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` associative array. +Navigate into each highlighter directory to see what styles (keys) it defines; +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]. + +[zshzle-Character-Highlighters]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting + +Some highlighters support additional configuration parameters; see each +highlighter's documentation for details. How to implement a new highlighter diff --git a/docs/highlighters/pattern.md b/docs/highlighters/pattern.md index b0b2b90..b64746b 100644 --- a/docs/highlighters/pattern.md +++ b/docs/highlighters/pattern.md @@ -7,7 +7,7 @@ This is the `pattern` highlighter, that highlights user defined patterns. ### How to tweak it To use this highlighter, associate patterns with styles in the -`ZSH_HIGHLIGHT_PATTERNS` array, for example in `~/.zshrc`: +`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`: # To have commands starting with `rm -rf` in red: ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')