Monday, March 28, 2011

Re: Way to clear line without removing the line?

On 03/28/2011 01:33 PM, David Kahn wrote:
> If I want to remove all contents of a line, I press 'd' twice.
> But in most cases I want the line to still be there (meaning
> the space, so after deleting I would have a blank line), so I
> tend to find myself when deleting afterward replacing the line
> (like shift + O).
>
> So if I am making any sense, is there a way to remove all
> contents of a line without removing the line itself (I guess
> similarly to using x to delete a character but for a whole
> line)?

In addition to the other answers suggesting "0D" and "^D", if you
want to clear the line and end up in insert mode at what was
previously the indent-level, you can use "S".

:help S

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