Answers for "vim ciw vs cw"

0

vim ciw vs cw

Here is an example:
foo bar baz
    ^

Typing cw and ciw will give the same result in this case (with the cursor 
positioned on the 'b' of 'bar'). Consider this:
foo bar baz
     ^

cw will yield:
foo b baz
     ^

where ciw will yield:
foo  baz
    ^

so it changes the whole word, regardless of the cursor position. Very 
useful, i love this command. Very useful is also the caw (or the aw) 
command:
foo bar baz
     ^
     
-> caw
foo baz
    ^

aw also contains the space. Try these commands with the v (visual) command, 
to see what they all do. Also, read motion.txt, part 6.
Posted by: Guest on September-18-2021

Browse Popular Code Answers by Language