3

I am looking to rebind some evil mode keys used in navigation and text selection. For example, I am able to successfully map the following evil-mode keys to the following functions:

(define-key evil-normal-state-map (kbd "w") 'evil-forward-little-word-begin)
(define-key evil-normal-state-map (kbd "b") 'evil-backward-little-word-begin)

But I don't know how to bind key combinations, like using dw to delete only to the next little word. For example, I type d C-h k w to describe the w key after I have typed d, and it is mapped to evil-forward-word-begin, and not to evil-forward-little-word-begin. Apparently, my key mapping above does not work for this scenario.

Is there a way to remap this keybinding, or am I being unreasonable in my attempt to remap the evil-little-word library?

Note that this question is a tangent to this question and I am trying to remap the evil-little-word library to the regular evil-mode keybindings.

modulitos
  • 2,482
  • 1
  • 22
  • 37

1 Answers1

4

Functions such as evil-delete (d) and evil-change (c) are operators, so you need to modify the evil-operator-state-map. If you want these modifications to show up in visual state as well, also modify evil-visual-state-map.

Have a look at Evil's bitbucket page for more details. It includes an old manual, but it will still give you enough of the core background to get started.

Dan
  • 32,980
  • 7
  • 102
  • 169