Re: How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread 'JB' via vim_use
Your {foo} to {bar} example has a more-efficient solution:

ci{

"Change inside curly-braces."

Works for quotation marks and brackets, too:

ci" or ci' or ci[ or ci<

You can be on either of the grouping characters or anywhere inside them.

Also, your ct= can be replaced with ce ("Change to end") using default 
delimiter chars.


Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Friday, February 26, 2021 11:04 AM, Eli the Bearded 
 wrote:

> On Fri, 26 Feb 2021, Joseph Wulf joseph.c.w...@gmail.com wrote:
>
> > I've a common problem that I've never been able to find a solution for.
>
> ...
>
> > With my cursor at "B" how can I delete from the current cursor position
> > (col 18) to the first double-quote mark (") efficiently?
>
> Delete up to a quote mark later in the line:
> dt"
>
> Delete up to the third quote mark later in the line:
> d3t"
>
> Delete up to a quote mark earlier in the line:
> dT"
>
> Delete up to and including a quote mark:
> df"
>
> Delete up to and including a quote mark earlier in the line:
> dF"
>
> Delete up to and including the second quote mark earlier in the line:
> d2F"
>
> Delete forward using a repeat of last to or including search:
> d,
>
> Delete backward using a repeat of last to or including search:
> d;
>
> Delete to column 40 (either forward or backward):
> d40|
>
> I'm a frequent user of the f/F/t/T motions. Often one or the other is
> the better choice to use due to frequency of characters used and
> context.
>
> In shell scripting, say, I may want to change {foo} to {bar} and
> sometimes it will be in single quotes and sometimes double quotes, so
> I'll use c2fo with the cursor on the {f} and then the . command works
> properly.
>
> Other times I'm changing a bunch of variable names all terminated at
> the = to new different names, so I'll use ct= first and c; later.
>
> Elijah

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/vqbi0gtckAjhhZfWpIVNli7_RBE0SyDe22HEb7SsOdOcG3uZHcdrPNFR_J80ox_c9ngOTBCLVNdLa6UkRzn0Nra3BL_Q_uEUQJkP8zn_c2M%3D%40protonmail.com.


Re: How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread Eli the Bearded
On Fri, 26 Feb 2021, Joseph Wulf  wrote:
> I've a common problem that I've never been able to find a solution for.
...
> With my cursor at "B" how can I delete from the current cursor position
> (col 18) to the first double-quote mark (") efficiently?

Delete up to a quote mark later in the line:
dt"

Delete up to the third quote mark later in the line:
d3t"

Delete up to a quote mark earlier in the line:
dT"

Delete up to and including a quote mark:
df"

Delete up to and including a quote mark earlier in the line:
dF"

Delete up to and including the second quote mark earlier in the line:
d2F"

Delete forward using a repeat of last to or including search:
d,

Delete backward using a repeat of last to or including search:
d;

Delete to column 40 (either forward or backward):
d40|

I'm a frequent user of the f/F/t/T motions. Often one or the other is
the better choice to use due to frequency of characters used and
context.

In shell scripting, say, I may want to change {foo} to {bar} and
sometimes it will be in single quotes and sometimes double quotes, so
I'll use c2fo with the cursor on the {f} and then the . command works
properly.

Other times I'm changing a bunch of variable names all terminated at
the = to new different names, so I'll use ct= first and c; later.

Elijah

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/4DnJwm6Pb7zfYm%40panix5.panix.com.


Re: How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread Joseph Wulf
That surely does it.  Thank you both, very much.

On Friday, February 26, 2021 at 11:30:53 AM UTC-5 sgovin...@yahoo.com wrote:

> On 2/26/2021 7:35 AM, Joseph Wulf wrote:
> > I've a common problem that I've never been able to find a solution for.
> > ...
> > ... how can I delete from the current cursor position ... to the first 
> > double-quote mark (") efficiently?
>
> In normal mode, consider "deleting with motion": dt" or df"
>
> --Suresh
>
>
>
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/9f334b4b-ed7d-4319-bd0f-c5b130cfc52cn%40googlegroups.com.


Re: How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread 'Suresh Govindachar' via vim_use

On 2/26/2021 7:35 AM, Joseph Wulf wrote:

I've a common problem that I've never been able to find a solution for.
...
... how can I delete from the current cursor position ... to the first 
double-quote mark (") efficiently?


In normal mode, consider "deleting with motion": dt" or df"

--Suresh



--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/76958eb7-7a89-96dc-fab3-54d6174cad3c%40yahoo.com.


Re: How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread Tony Mechelynck
Moving to the next " is f" and the f motion is |inclusive| so df" should do it.

See ":help f" (without the quotes).

Best regards,
Tony.

On Fri, Feb 26, 2021 at 5:00 PM Joseph Wulf  wrote:
>
> I've a common problem that I've never been able to find a solution for.
>
> With a sample script line like the following:
>  printf "A(%14s), B(%s), C(%14s), D(%14s), E(%14s), F(%3s), G(%-24s), H(%4s), 
> I(%14s), J(%s),", 
> "${x01}","${x02}","${x03}","${x04}","${x05}","${x06}","${x07}","${x08}","${x09}","${x10}"
>
> With my cursor at "B" how can I delete from the current cursor position (col 
> 18) to the first double-quote mark (") efficiently?
>
> Thank you.
>
> --
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vim_use/c8220bfd-cad2-4365-8c74-5826488d110dn%40googlegroups.com.

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAJkCKXsS90Tc_4h%3DdjSs%3Dngmy7y3hb7ZRjyxn8GaTQLEyB8NeA%40mail.gmail.com.


How to delete from the current cursor position to a particular character on the same line?

2021-02-26 Thread Joseph Wulf
I've a common problem that I've never been able to find a solution for.

With a sample script line like the following:
 printf "A(%14s), B(%s), C(%14s), D(%14s), E(%14s), F(%3s), G(%-24s), 
H(%4s), I(%14s), J(%s),", 
"${x01}","${x02}","${x03}","${x04}","${x05}","${x06}","${x07}","${x08}","${x09}","${x10}"

With my cursor at "B" how can I delete from the current cursor position 
(col 18) to the first double-quote mark (") efficiently?

Thank you.

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/c8220bfd-cad2-4365-8c74-5826488d110dn%40googlegroups.com.