pi_paren.txt 2.7 KB

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