Home » Questions » Computers [ Ask a new question ]

Gvim shortcut for { }

Gvim shortcut for { }

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

Asked by: Guest | Views: 193
Total answers/comments: 2
Guest [Entry]

"Things to check:

make sure loaded_matchparen is enabled. :let loaded_matchparen = 1
If disabled, use :DoMatchParen to turn it on.
matchparen only works if 'compatible' is not set.
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 (%) ;-)"
Guest [Entry]

"From http://www.moolenaar.net/habits.html, beyond just % you have a couple more options.

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.
Use [{ to jump back to the ""{"" at the start of the current code block.
Use gd to jump from the use of a variable to its local declaration."