Friday, March 11, 2016

Re: vim: least key stroke to replace a word

在 2015年2月18日星期三 UTC+8上午2:18:15,ping写道:
> experts:
> I know this looks stupid and simple, but I don't know the answer right now.
>
> say I want to replace a word :
>
> from:
>
> abc 456
>
> to:
> 123456
>
> what I did is:
> 1. put my cursor in a, then cw123<esc>x , 7 strokes
> 2. put my cursor in b, then caw123<esc>, 7strokes
> 3. put my cursor in a, then dwi123<esc>, 7 strokes
>
> it looks cw and dw behaves non-consistently, which I know is by the design.
>
> I'm editing an old doc full of typos and spelling errors, etc, and I
> need to do this quite often, does anyone knows of a
> least-strokes-method (to protect my fingers) ?

abc 456
type 123
on 1, hit yw
on a, hit dw"0P
if like this, average 5keys
abc 456
abc 456
abc 456

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

Post a Comment