David542
David542

Reputation: 110153

Moving codefolds in Vim

I have the following two code folds:

enter image description here

How would I move the bottom code fold above the top one? Is there a shortcut for that?

Upvotes: 0

Views: 46

Answers (1)

filbranden
filbranden

Reputation: 8898

You can operate on a fold as a whole as if you're operating on a single line. So simply using dd here will cut the whole folded block.

See :help fold-behavior:

[...] When using an operator, a closed fold is included as a whole. Thus dl deletes the whole closed fold under the cursor.

Upvotes: 1

Related Questions