blob: 810532797dca32c1e79d3aa9d8978a4199a30277 [file] [log] [blame]
Bram Moolenaar446cb832008-06-24 21:56:24 +00001*pi_paren.txt* For Vim version 7.2a. Last change: 2008 Jun 16
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +00002
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
Bram Moolenaarfa2e0442007-08-18 16:21:50 +000015The plugin installs CursorMoved, CursorMovedI and WinEnter autocommands to
16redefine the match highlighting.
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +000017
Bram Moolenaar446cb832008-06-24 21:56:24 +000018 *:NoMatchParen* *:DoMatchParen*
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +000019To disable the plugin after it was loaded use this command: >
20
21 :NoMatchParen
22
23And to enable it again: >
24
25 :DoMatchParen
26
Bram Moolenaarfd2ac762006-03-01 22:09:21 +000027The highlighting used is MatchParen. You can specify different colors with
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +000028the ":highlight" command. Example: >
29
Bram Moolenaarfd2ac762006-03-01 22:09:21 +000030 :hi MatchParen ctermbg=blue guibg=lightblue
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +000031
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
Bram Moolenaar910f66f2006-04-05 20:41:53 +000042The 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.
Bram Moolenaar9964e462007-05-05 17:54:07 +000047- 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay
Bram Moolenaar910f66f2006-04-05 20:41:53 +000048 in a long line with syntax highlighting.
Bram Moolenaare2f98b92006-03-29 21:18:24 +000049
Bram Moolenaar446cb832008-06-24 21:56:24 +000050
51If you would like the |%| command to work better, the matchit plugin can be
52used, see |matchit-install|. This plugin also helps to skip matches in
53comments. This is unrelated to the matchparen highlighting, they use a
54different mechanism.
55
Bram Moolenaar5e3cb7e2006-02-27 23:58:35 +000056==============================================================================
57 vim:tw=78:ts=8:ft=help:norl: