It seems for me that cw and ce commands works the same while dw and de and
other operator like commands have a different behaviour. I did testing with
"vim -u NONE" (I also use the default 'cpo').
How to reproduce:
put the cursor at the beginning of word1 and try both cw and ce normal
commands:
word1 word2
In both cases the space between word1 and word2 is not deleted, while I expect
that cw would make the change up to word3.
Best regards,
Marcin Szamotulski
I think that is a strange historic Vi behaviour that is required by POSIX
nowadays. We could possibly add another flag to 'cpo' to work around it,
but my feeling is that too many people are accustomed to the way it works
currently that it isn't worth the trouble. (We already have the 'w' flag
for another strange behaviour when using the c motion on blanks)
regards,
Christian
From the help:
> *cw* *cW*
> Special case: When the cursor is in a word, "cw" and "cW" do not include the
> white space after a word, they only change up to the end of the word. This is
> because Vim interprets "cw" as change-word, and a word does not include the
> following white space.
> {Vi: "cw" when on a blank followed by other blanks changes only the first
> blank; this is probably a bug, because "dw" deletes all the blanks; use the
> 'w' flag in 'cpoptions' to make it work like Vi anyway}
>
> If you prefer "cw" to include the space after a word, use this mapping: >
> :map cw dwi
> Or use "caw" (see |aw|).
Great. I don't think adding another cpo flag is necessary as ":help cw" also
suggest a nice solution:
map cw dwi
or to use "caw" command.
Thanks!
Marcin