0

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 ?

1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.