Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim folding - how to copy unfolded lines

I would like to copy/delete all the lines except the folded lines and vice-versa. How do I do that? It is ok if I have to use a plugin for that as well. But, I would love to have that functionality.

like image 257
would_like_to_be_anon Avatar asked Nov 04 '25 08:11

would_like_to_be_anon


1 Answers

:folddoopen y W

yanks every non-folded line into register w. W is used to append to register w.

:folddoopen d

deletes every non-folded line.

There's of course a mirror command, :folddoclose that acts on every folded line.

like image 84
romainl Avatar answered Nov 05 '25 23:11

romainl