You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
831 B

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