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.

In many cases it would be useful to search for text only in the currently visible fold titles, instead of having Vim automatically opening lots of different folds along the way. Is there a way to do that?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I don't know of a way to only search in the fold text (which is usually just the first line of the fold, plus a little extra information), but you can control what actions open folds by setting the 'foldopen' option. For example:

:set foldopen-=search

See ":help 'foldopen'" (the single quotes are meant to be typed).

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.