Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is shortcut the moved between { and } in gvim editor ? how to achieve this ?

share|improve this question
up vote 7 down vote accepted

Things to check:

  1. make sure loaded_matchparen is enabled. :let loaded_matchparen = 1
  2. If disabled, use :DoMatchParen to turn it on.
  3. matchparen only works if 'compatible' is not set.
  4. The characters to be matched come from the 'matchpairs' option. Is it possible this has been overwritten? The default is `:set matchpairs="(:),{:},[:]"

Try :help matchparen to see other things to try.

Last but not least, make sure you hold down that old Shift Key when pressing 5 (%) ;-)

share|improve this answer

Put your cursor on one of the braces, and press the % key to move to the matching brace.

share|improve this answer
no. i am not able do it – joe Oct 20 '09 at 15:32
hold shift and press 5? – DaveParillo Oct 20 '09 at 15:36

From, beyond just % you have a couple more options.

  1. Use % to jump from an open brace to its matching closing brace. Or from a "#if" to the matching "#endif". Actually, % can jump to many different matching items. It is very useful to check if () and {} constructs are balanced properly.
  2. Use [{ to jump back to the "{" at the start of the current code block.
  3. Use gd to jump from the use of a variable to its local declaration.
share|improve this answer

Are you looking for the %, which will match parenthesis and braces.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .