In emacs evil-mode, how do I bind a sequence of keys so that it pre-populates the ex-mode command line and positions the cursor? In vim, I can do this:
nnoremap g/r :%s//g<left><left>
In emacs, I tried this (and several options):
(define-key evil-normal-state-map "g/" nil) (define-key evil-normal-state-map (kbd "g/r") (lambda () (interactive) (kbd ":%s/")))
This has no effect, and I do not see any messages after trying to layout the keyboard.
It seems emacs used the useful evil-ex-read-command function, which sent the input to the evil mode command line:
https://github.com/magnars/.emacs.d/blob/master/site-lisp/evil/evil-ex.el#L554
But this feature is no longer available.
emacs evil-mode
Justin M. Keyes
source share