Monday, August 1, 2011

Re: Moving a fold? [Was: A mile of dashes added to foldtext]

On Aug 1, 6:40 am, Erik Christiansen <dva...@internode.on.net> wrote:
> Vim's help has a number of fold-related commands, but I'm having trouble
> finding a command to delete a fold, for pasting elsewhere. So not zd,
>         ---------------------------
> which just negates the fold. (The perspective provided by folding
> reveals that some folds need to be moved.)
>
> Perhaps there is a "to end of fold" motion, to use with d, even though I
> don't see one in motion.txt.

Most operations done on a closed fold will act on all lines within the
fold. For example, if you have a big 1234-line fold, close the fold
and press "dd" on the foldtext as if you were deleting just one line.
The entire folded text will be deleted, ready to put elsewhere.

If you need more fine-grained control, you're also right to think of a
"to end of fold" motion. ]z does exactly this, if the cursor is inside
an open fold. [z similarly goes to the start of the open fold. You can
also move between folds with zj/zk.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment