Update zsh-syntax-highlighting plugin
[zsh.git] / .zsh / zsh-syntax-highlighting / docs / highlighters / pattern.md
1 zsh-syntax-highlighting / highlighters / pattern
2 ------------------------------------------------
3
4 This is the `pattern` highlighter, that highlights user-defined patterns.
5
6
7 ### How to tweak it
8
9 To use this highlighter, associate patterns with styles in the
10 `ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:
11
12 # Declare the variable
13 typeset -A ZSH_HIGHLIGHT_PATTERNS
14
15 # To have commands starting with `rm -rf` in red:
16 ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
17
18 The syntax for values is the same as the syntax of "types of highlighting" of
19 the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
20 manual page][zshzle-Character-Highlighting].
21
22 [zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting