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