Quantcast

What do you do when you make the wrong movement with 'c'?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What do you do when you make the wrong movement with 'c'?

Mike Ciul
Hi everyone, I'm new here... I hope you don't mind if I jump in with a question...

I often make the wrong movement when changing text with 'c'. For example, I was just editing this line in bash vi mode:

grep org:date_founded official.cross_ling.sorted.tab | cutc -d tab 6 | hist

I was in normal mode at the start of the line (having just hit <esc>k to edit the previous command), and I wanted to change the "org:date_founded" to another search string, so I typed:

wcw

This was not what I really wanted. I should have typed wcW, but now I'm stuck in insert mode with the insertion point to the left of the colon:

grep :date_founded official.cross_ling.sorted.tab | cutc -d tab 6 | hist

So I hit

<esc>cW

Except that wasn't what I wanted either. When I now hit <esc>, the cursor goes to the column before the change, which is the space after "grep". When I hit cW, it replaces the space, and I have:

grep:date_founded official.cross_ling.sorted.tab | cutc -d tab 6 | hist

And the insertion point is still to the left of the colon. I could get out of this by typing

<esc>lcW<space>

but by this point I've lost my flow.

What do you do when you use the wrong movement with a change? Do you soldier on in insert mode? Escape and undo? Escape and move to the right place before changing? Do you have habits or mnemonics that help you know where the cursor will be after you hit Escape? Or do you just chalk it up as a learning experience and try to avoid making the same mistake again?

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What do you do when you make the wrong movement with 'c'?

Tim Chase
On 2017-04-14 13:32, Mike Ciul wrote:
> What do you do when you use the wrong movement with a change? Do
> you soldier on in insert mode? Escape and undo? Escape and move to
> the right place before changing? Do you have habits or mnemonics
> that help you know where the cursor will be after you hit Escape?
> Or do you just chalk it up as a learning experience and try to
> avoid making the same mistake again?

The one that stands out as "most frequent" is the escape+undo, but
I've done a little of most of those depending on the context.  I've
also been known to do the soldier on and then delete the remainder
after my insertion (not sure whether your "soldier on" included
making the deletions/edits in insert mode in addition to the text
insertion).

Additionally, I use t/T/f/F/;/, frequently which I've found improves
my accuracy.  I tend not to use w/W/b/B/e/E nearly as much unless (1)
the word I'm in is clearly whitespace delineated letting me use
w/b/e and W/B/E interchangeably, and (2) I don't need to do a very
large count multiplier.  I've found it's much easier for me to do a
quick visual count of "r"s and then use something like "c3tr".

-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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What do you do when you make the wrong movement with 'c'?

Mike Ciul
On Saturday, April 15, 2017 at 11:45:05 AM UTC-4, Tim Chase wrote:

> Additionally, I use t/T/f/F/;/, frequently which I've found improves
> my accuracy.  I tend not to use w/W/b/B/e/E nearly as much unless (1)
> the word I'm in is clearly whitespace delineated letting me use
> w/b/e and W/B/E interchangeably, and (2) I don't need to do a very
> large count multiplier.  I've found it's much easier for me to do a
> quick visual count of "r"s and then use something like "c3tr".

Cool! That's really useful. I've never tried using a count with t or f... maybe I will.

I'm always surprised when people say "nobody knows what ; does" or "nobody uses ;" - I use it all the time! I'm not very good at visually counting occurrences of a letter on a line, so it comes in handy. I even use , to back up when I've hit it too many times...

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...