If you mean to bind the key combination
- Press and release g
- Press and release /
- Press and release r
your string in kdb
should be "g / r"
.
Emacs is not based on keystrokes as vim is, but keystrokes are just a means to execute functions. So pressing k
in normal mode does not execute the function k
(as in vim), but self-insert-char
. That means that you do not bind the combination g / r
to equal some other keystrokes, but rather to call an arbitrary function. And evil defines an evil-ex
function, that does exactly what you want (Actually it's the exact function, that is called, when you press :
in normal mode).
Untested but it should work
(define-key evil-normal-state-map (kbd "g / r") (lambda () (evil-ex "%s/")))