📜  vim ciw vs cw - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:10.650000             🧑  作者: Mango

代码示例1
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.