How do I preserve folds in VIM when cutting and pasting?

Posted by eeeeaaii on Stack Overflow See other posts from Stack Overflow or by eeeeaaii
Published on 2010-05-20T21:11:05Z Indexed on 2010/05/20 21:20 UTC
Read the original article Hit count: 229

Filed under:
|

In vim, you can create a fold with zf, so if is %, you can neatly fold a delimited block.

  • is there a way to select some text in visual mode and automatically fold that?

  • I've noticed that if I select a closed fold and use dd to delete it, then go somewhere else and use P to paste it, the fold will disappear and the fold will be expanded. I want to cut the folded stuff and paste it and have it paste with the folds still intact and closed.

© Stack Overflow or respective owner

Related posts about vim

Related posts about gvim