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.

I have started to use set foldmethod=marker, because I find it more convenient to use rather than syntax.

But it has the disadvantage of needing to write // {{{ my title and // }}} around any folding code candidate.

It would be nice if I could select a part of code in visual mode, and call a command ( or some commands) that would insert the two markers before and after the selected code.

Are there any way to do that in vim ?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I found it. Visually select the block then input the command :fold

It automatically writes the two tags /*{{{*/ and /*}}}*/.

share|improve this answer
add comment

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.