In emacs evil-mode, how do I bind a key sequence so that it pre-populates the evil-mode ex 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 variations):

(define-key evil-normal-state-map "g/" nil) (define-key evil-normal-state-map (kbd "g/r") (lambda () (interactive) (kbd ":%s/")))

It has no effect, and I don't see any messages after trying the keymap.

It looks like emacs used to have a useful function evil-ex-read-command that sent input to the evil-mode command line:

https://github.com/magnars/.emacs.d/blob/master/site-lisp/evil/evil-ex.el#L554

But that function doesn't seem to be available anymore.