6 ms·
Instead of c2w I prefer v2ec selecting with v helps me avoid making mistakes.
by oolongCat 10y ago
Instead of
c2w
I prefer
v2ec
selecting with v helps me avoid making mistakes.
- bbrik 10y agoThe advantage of c2w is that it combines everything in a repeatable (using .) operation.
- oolongCat 10y agoand so does v2ec
- godd2 10y agoIt'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".
- grault 10y agoct" or even ci" (or ci) ci] etc) is really useful to reset the inner contents of text delimited by ")] etc.. I use these a lot - http://fuckyeahvim.tumblr.com/image/122372862496 http://fuckyeahvim.tumblr.com/image/122372862496
- vacri 10y agoci", ci), ci]... I love these, and use them all the time.