Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Just like you could jump between pairs, i.e (), can I extend this feature to jump between beginning tags and ending tags?

i.e in bash, jump between if and fi

share|improve this question
On my system it does exactly that. I assume the matchit plugin is responsible for that. Usually it's installed by default with every larger vim installation. It is deactivated, though. – Marco Jan 4 '13 at 10:27
up vote 5 down vote accepted

Here is an example. Suppose you have this code and you press %, the cursor jumps between { and } parens:

enter image description here

Matchit.vim extends this functionality, you can do the same with () just move cursor on ( and press %, it jumps between pairs of parenthesis ( )'s, { }'s, [ ]'s. It also jumps between opening and closing tags of C style comments /* and */. And it's smart enough to jump between C preprocessor directives - from #if to #endif and match #elif or #else in between

for more info refer this page

share|improve this answer

Your Answer


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.