pattern, regexp: Declare the variable in the documentation example
Fixes #590.
This commit is contained in:
parent
e900ad8bad
commit
3dc74b5c2c
@ -9,6 +9,9 @@ This is the `pattern` highlighter, that highlights user-defined patterns.
|
|||||||
To use this highlighter, associate patterns with styles in the
|
To use this highlighter, associate patterns with styles in the
|
||||||
`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:
|
`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
# Declare the variable
|
||||||
|
typeset -A ZSH_HIGHLIGHT_PATTERNS
|
||||||
|
|
||||||
# To have commands starting with `rm -rf` in red:
|
# To have commands starting with `rm -rf` in red:
|
||||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ patterns.
|
|||||||
To use this highlighter, associate regular expressions with styles in the
|
To use this highlighter, associate regular expressions with styles in the
|
||||||
`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`:
|
`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`:
|
||||||
|
|
||||||
|
typeset -A ZSH_HIGHLIGHT_PATTERNS
|
||||||
ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold)
|
ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold)
|
||||||
|
|
||||||
This will highlight "sudo" only as a complete word, i.e., "sudo cmd", but not
|
This will highlight "sudo" only as a complete word, i.e., "sudo cmd", but not
|
||||||
|
Loading…
Reference in New Issue
Block a user