Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
2  
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

1 Answer 1

up vote 4 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

 
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.