Evil-mode defining ex commands & redefining whole line commands (eg. dd)

Russell Dunphy russell at russelldunphy.com
Sun Sep 14 00:17:58 CEST 2014


Hi, new to Emacs (Evil-mode persuading me that it’s worth attempting the switch). Have a few questions.

I’m trying to get adhoc key mappings working as they would in vim. So for example if I open a new Clojure file I might want to quickly set up a mapping to run it. In vim this would be something like:

:map ,t :!lein exec %<CR>

Is there a way to implement the `map` ex command in evil-mode to make creating arbitrary, temporary mappings like this possible and easy?

Second question relates to trying to get evil-mode to play nicely with paredit. I’m using `evil-paredit-mode` which makes most things work, but whole line commands such as `dd` don’t seem to work, and I can’t work out how to rebind them. I’ve tried the following:

(evil-define-key 'normal evil-paredit-mode-map (kbd “dd”)
  (lambda () (move-beginning-of-line)
             (evil-paredit-delete-line))

But I get the error “key sequence dd starts with non-prefix key d”.

Thanks in advance for your help!

Russell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20140913/11dbf4b2/attachment.htm 


More information about the implementations-list mailing list