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 16:24, '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.

I'm having a little trouble parsing (1) where the cursor is (it
sounds like you're describing it at the last "t" of the first line)
and (2) what you want the final results to be. Do you want

example.net <-- actually importan.example.com <-- not actually important

or

example.net <-- actually importan<-- not actually important

Or are the "<-- ..." meta-commentary and not actually content in the
file? It would help to have unannotated "before" and "after" and
"where is the cursor".

Also, is this a one-off thing where you're trying to optimize
something manually, or should this be automated across all lines (or
lines matching some condition) in the file? (noting that a :s
command can be repeated with either "@:" or "&" or "g&" depending on
intent)

-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

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