Wednesday, April 28, 2010

Re: Marking lines for deletion

On 04/28/2010 01:53 PM, Dotan Cohen 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?

While AK has provided another terse answer (use line-wise visual
mode), if there's something notable about the end, you can often
use it as a motion such as

d}

to delete from the current location down to the next blank line.
If you want to force an otherwise-character-wise motion to be
line-wise, you can use "V" as an infix operator:

dV}

as detailed at

:help o_V

(a subsection of the corresponding "FORCING A MOTION TO BE
LINEWISE, CHARACTERWISE OR BLOCKWISE")

Reading through

:help motion.txt

gives you an abundance of motions you can use with operators
(such as "d" in your case) that can make your editing much faster.

-tim

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