Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

and so does v2ec


It's not the same. That will only repeat the change of the number of characters of the length of those 2 words. c2w, when repeated, will change 2 words, no matter how long the words are.

For example:

    This is a string of text.
    This is a string of text.
If the cursor is at the "i" of "is" on line 2, and you type v2echello<Esc>, you will have:

    This is a string of text.
    This hello string of text.
If you move the cursor to the "s" of "string" on the first line, and press ".", you will get:

    This is a hellong of text.
    This hello string of text.
However, if you had used c2w, it would have replaced "string of" with "hello" like so:

    This is a hello text.
    This hello string of text.
Visual mode is lossy in terms of text objects. It only remembers counts of character movements, that's why it replaced 4 characters with "hello" instead of replacing 2 words with "hello".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: