Thursday, April 29, 2010

Re: Marking lines for deletion

On Apr 28, 1:53 pm, Dotan Cohen <dotanco...@gmail.com> wrote:
> I use VIM for editing mails. Often I must trim responses, but I do not
> know in advance how many lines. Is there a way to mark "start delete",
> then J my way down to the last line, and there to active the delete?
>

You have lots of answers, all good, but yet one more would be to do
exactly as you say:

1. mark "start delete" with md (sets mark d)
2. move to end of text to delete
3. Use the ex command, ":d" to delete the lines, with a range starting
at your previous mark like this:
:d,.d

Or, instead of using an ex command in (3), you could use a motion as
suggested before, to delete up to the mark:
d'd

See :help bookmark for details.

--
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: