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.

31 lines
1.1 KiB

3 years ago
  1. zsh-syntax-highlighting / highlighters / brackets
  2. -------------------------------------------------
  3. This is the `brackets` highlighter, that highlights brackets and parentheses, and
  4. matches them.
  5. ### How to tweak it
  6. This highlighter defines the following styles:
  7. * `bracket-error` - unmatched brackets
  8. * `bracket-level-N` - brackets with nest level N
  9. * `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket
  10. To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
  11. for example in `~/.zshrc`:
  12. ```zsh
  13. # To define styles for nested brackets up to level 4
  14. ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
  15. ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
  16. ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
  17. ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
  18. ```
  19. The syntax for values is the same as the syntax of "types of highlighting" of
  20. the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
  21. manual page][zshzle-Character-Highlighting].
  22. [zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting