Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

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
2  
hold shift and press 5? –  DaveParillo Oct 20 '09 at 15:36

From http://www.moolenaar.net/habits.html, 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.