Tuesday, September 4, 2018

Re: How do I delete from the end of the line through space (up to) the first word?

On 2018-09-04, 'Grant Taylor' via vim_use wrote:
> How do I delete from the end of the line (where the cursor is at)
> through the space after the first word?
>
> example.net <-- actually important
> different.example.com <-- not actually important
>
> What is the optimal way to delete from (and including) the t at the
> end of the line up through the space after the first Word?
>
> I'm looking for something functionally comparable to D when the
> cursor is on the space after the first word, just coming from the
> opposite direction.
>
> diW works and multiple dot repetitions get the job done. But i feel
> like there is a better method.

The best way to move to the first space on a line is to move to the
start of the line, then find the next space to the right. The best
solution to your problem that I know of would be this:

^f D

Any other solution that tries to find the first space by working
backwards from the end of the line is going to require more typing,
unless you create a macro for it.

Regards,
Gary

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: