How do I copy all lines from all folds, excluding the fold titles?
2 Answers
If by 'title' you mean the fold summary note that they are not copied by the yank operation.
The following sequence in normal mode will copy the content on the entire buffer:
ggyG
Or if you prefer a command:
:%y
If you are folding using the foldmethod
marker
and your maker is {{{
then solution is to:
- Filter out the
marker
line:
:g/\({{{\)\|\(}}}\)/d
- Copy the buffer content
:%y
- Undo the filtering
:u
You can make it in one command:
:silent! g/\({{{\)\|\(}}}\)/d | %y | silent! u
ggyG
not working?foldmethod=marker
. If that is true maybe could you add that information to the question. It would be good that you tell us what is the marker you are using. I believe it would also be helpful if you could add a short example on input and the corresponding output you expect.