xref: /vim-8.2.3635/runtime/doc/pi_paren.txt (revision 98056533)
1*pi_paren.txt*  For Vim version 8.2.  Last change: 2013 May 08
2
3
4		  VIM REFERENCE MANUAL    by Bram Moolenaar
5
6
7Highlighting matching parens			*matchparen*
8
9The functionality mentioned here is a |standard-plugin|.
10This plugin is only available if 'compatible' is not set.
11
12You can avoid loading this plugin by setting the "loaded_matchparen" variable: >
13	:let loaded_matchparen = 1
14
15The plugin installs CursorMoved, CursorMovedI and WinEnter autocommands to
16redefine the match highlighting.
17
18					*:NoMatchParen* *:DoMatchParen*
19To disable the plugin after it was loaded use this command: >
20
21	:NoMatchParen
22
23And to enable it again: >
24
25	:DoMatchParen
26
27The highlighting used is MatchParen.  You can specify different colors with
28the ":highlight" command.  Example: >
29
30	:hi MatchParen ctermbg=blue guibg=lightblue
31
32The characters to be matched come from the 'matchpairs' option.  You can
33change the value to highlight different matches.  Note that not everything is
34possible.  For example, you can't highlight single or double quotes, because
35the start and end are equal.
36
37The syntax highlighting attributes are used.  When the cursor currently is not
38in a string or comment syntax item, then matches inside string and comment
39syntax items are ignored.  Any syntax items with "string" or "comment"
40somewhere in their name are considered string or comment items.
41
42The search is limited to avoid a delay when moving the cursor.  The limits
43are:
44- What is visible in the window.
45- 100 lines above or below the cursor to avoid a long delay when there are
46  closed folds.
47- 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay
48  in a long line with syntax highlighting.
49- A timeout of 300 msec (60 msec in Insert mode). This can be changed with the
50  g:matchparen_timeout and g:matchparen_insert_timeout variables and their
51  buffer-local equivalents b:matchparen_timeout and
52  b:matchparen_insert_timeout.
53
54If you would like the |%| command to work better, the matchit plugin can be
55used, see |matchit-install|.  This plugin also helps to skip matches in
56comments.  This is unrelated to the matchparen highlighting, they use a
57different mechanism.
58
59==============================================================================
60 vim:tw=78:ts=8:noet:ft=help:norl:
61