When using foldmethod=marker
, how do you select or reference exactly the contents of the current fold? I want to swap the order of two folds. If they were paragraphs, I would do dap
{
p
. However, I can't find a corresponding daz
. I think the answer is obvious, but I sure can't find it here or on Google. Possibly related to this question.
MCVE:
Fold 1 {{{
}}}
Fold 2 {{{
}}}
Fold 3 {{{
}}}
- vi: set foldmethod=marker: -
Put the cursor on Fold 2
. Then dzj
removes the contents of Fold 2
, and also the Fold 3
line. Or, put the cursor on the }}}
of Fold 2
, and dzk
kills the end of Fold 1
as well. Similar results from d[z
and d]z
.
zd
removes the fold markers, but I want to actually grab the contents of the fold.
If I could do something like viz
d
, that would work great — but searches for "visual" and "folding" are giving me lots of hits about v<motion>zf
, which is not what I want.
So far, the only options I have found are:
- to delete,
zc
dd
(close the fold, then delete the resulting single line). - to select in visual mode,
zc
V
Are those indeed the Right Things to use?