1

In vi, c w stops at the end of the current word (that movement is normally e, as in c e). This is different from w alone or d w, which go up to the beginning of the next word.

A popular Vim configuration causes c w to do work like other w commands, where the "word" movement takes you UP TO the next word. Consuming any whitespace.

How do I make c w work in evil as it does in this Vim configuration?

Evil: 1.14.0
Emacs: 27.1

3
  • 2
    I cannot reproduce that cw behavior in Vim at all. Do you have a complete repro?
    – wasamasa
    Feb 8 at 10:42
  • 1
    You must have rebound cw to dwi or caw in Vim. It's suggested in the manual, but it's not the default. Feb 8 at 10:46
  • Wow, that's wild. I just tried on vim without my vimrc, and you're right. Didn't expect that to be part of my local config! Thanks guys, and thanks for the edit.
    – hraban
    Feb 8 at 12:13
1

Do C-h v evil-want-change-word-to-end RET, then customize that variable from t to nil.

Reference:

evil-want-change-word-to-end is a variable defined in ‘evil-vars.el’. Its value is t

You can customize this variable.

Documentation: Whether ‘cw’ behaves like ‘ce’.

2
  • no way. They really thought of everything. Thank you Terry.
    – hraban
    Feb 9 at 9:44
  • @hraban Indeed. evil is one of the best IMO. :-)
    – TerryTsao
    Feb 9 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.