Bram Moolenaar | e0d7b3c | 2007-05-12 14:23:41 +0000 | [diff] [blame] | 1 | *pi_paren.txt* For Vim version 7.1. Last change: 2006 Jun 14 |
Bram Moolenaar | 5e3cb7e | 2006-02-27 23:58:35 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
| 5 | |
| 6 | |
| 7 | Highlighting matching parens *matchparen* |
| 8 | |
| 9 | The functionality mentioned here is a |standard-plugin|. |
| 10 | This plugin is only available if 'compatible' is not set. |
| 11 | |
| 12 | You can avoid loading this plugin by setting the "loaded_matchparen" variable: > |
| 13 | :let loaded_matchparen = 1 |
| 14 | |
| 15 | The plugin installs CursorMoved autocommands to redefine the match |
| 16 | highlighting. |
| 17 | |
| 18 | To disable the plugin after it was loaded use this command: > |
| 19 | |
| 20 | :NoMatchParen |
| 21 | |
| 22 | And to enable it again: > |
| 23 | |
| 24 | :DoMatchParen |
| 25 | |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 26 | The highlighting used is MatchParen. You can specify different colors with |
Bram Moolenaar | 5e3cb7e | 2006-02-27 23:58:35 +0000 | [diff] [blame] | 27 | the ":highlight" command. Example: > |
| 28 | |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 29 | :hi MatchParen ctermbg=blue guibg=lightblue |
Bram Moolenaar | 5e3cb7e | 2006-02-27 23:58:35 +0000 | [diff] [blame] | 30 | |
| 31 | The characters to be matched come from the 'matchpairs' option. You can |
| 32 | change the value to highlight different matches. Note that not everything is |
| 33 | possible. For example, you can't highlight single or double quotes, because |
| 34 | the start and end are equal. |
| 35 | |
| 36 | The syntax highlighting attributes are used. When the cursor currently is not |
| 37 | in a string or comment syntax item, then matches inside string and comment |
| 38 | syntax items are ignored. Any syntax items with "string" or "comment" |
| 39 | somewhere in their name are considered string or comment items. |
| 40 | |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 41 | The search is limited to avoid a delay when moving the cursor. The limits |
| 42 | are: |
| 43 | - What is visible in the window. |
| 44 | - 100 lines above or below the cursor to avoid a long delay when there are |
| 45 | closed folds. |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 46 | - 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 47 | in a long line with syntax highlighting. |
Bram Moolenaar | e2f98b9 | 2006-03-29 21:18:24 +0000 | [diff] [blame] | 48 | |
Bram Moolenaar | 5e3cb7e | 2006-02-27 23:58:35 +0000 | [diff] [blame] | 49 | ============================================================================== |
| 50 | vim:tw=78:ts=8:ft=help:norl: |