RC | 23 Sep 22:36 2014

Remap C-SPC binding

evil-mode seems to take over the C-w and C-SPC key bindings.
I was able to unbind C-w using the following commands, but C-SPC still 
seems bound in insert mode.

(eval-after-load "evil-maps"
  (dolist (map '(evil-motion-state-map
    (define-key (eval map) "\C-w" nil)))

(eval-after-load "evil-maps"
  (dolist (map '(evil-motion-state-map
                 evil-insert-state-local-map ))
    (define-key (eval map) (kbd "C-SPC") nil)))

I am using emacs 24.3 and updated evil from MELPA.

Any suggestions to fix this will be appreciated.
Alan Schmitt | 23 Sep 19:29 2014

What is the best way to rebind common keys?


I used evil a while back, but I stopped since the physical key positions
were not practical (I was using a dvorak layout then). I would like to
give evil a second try, but this time choosing my own keybindings
adapted to my current layout (bépo).

I thus have two questions.

1. Is there a summary of the default evil bindings, and the functions to
which they are bound?
2. What is the recommended way to change bindings? I looked at
http://www.emacswiki.org/emacs/Evil and it seems I could simply do
a "(define-key evil-normal-state-map … …)". Is there a better way?




OpenPGP Key ID : 040D0A3B4ED2E5C7
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Nikolai Weibull | 19 Sep 22:01 2014

Mapping ( and ) in paredit mode


I would like to map ( and ) as prefix keys to various other mappings
to paredit mode functions:

(evil-define-key 'normal paredit-mode-map
  "((" 'evil-paredit-backward-slurp-sexp
  "))" 'evil-paredit-forward-slurp-sexp

This only works after a while for inexplicable reasons when you’ve
clicked around a bit and tried to execute a couple of mappings in a
buffer with Paredit enabled.  The problem is that ( is mapped to
backward-sentence in evil-motion-state-map, which seems to take

How do I go about removing the mapping of ( to backward-sentence in
evil-motion-state-map for buffers that have Paredit enabled?

(I’m sure that this worked without any issues before, but I’ve changed
my configuration somewhat and now I get this weird behavior.)

Oh, using

     (define-key evil-normal-state-local-map "(("

seems to work.  So is that the preferred way of solving this situation?

(Continue reading)

Nikolai Weibull | 17 Sep 23:02 2014

define-key versus evil-define-key


What’s the preferred way of adding keys to a given mode’s map?


(define-key evil-motion-state-local-map "\C-b"


(evil-define-key 'motion calendar-mode-map "\C-b"


(From an ease-of-use perspective, the second is better, as it allows
you to easily map more keys, but I’m wondering from a “the right way
to do it” perspective.)

implementations-list mailing list
implementations-list <at> lists.ourproject.org
Nikolai Weibull | 16 Sep 22:59 2014

Motion in grep-mode


Why isn’t grep-mode’s bindings overriding those defined in
motion-state?  Since grep-mode is derived from compilation-mode, I’d
have thought that it’d work.

I’ve also tried

  (evil-set-initial-state 'grep-mode 'motion)

without success (even though (evil-motion-state-p) returns t).

implementations-list mailing list
implementations-list <at> lists.ourproject.org
Russell Dunphy | 14 Sep 00:17 2014

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

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)

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

Thanks in advance for your help!

implementations-list mailing list
implementations-list <at> lists.ourproject.org
Gabriel Barta | 11 Sep 05:14 2014

evil-noautochdir : keeping the working directory the same as you work


I disliked the emacs behaviour where the current directory would always be the
one containing the current file. So I wrote a bit of elisp to change it, named
according to the equivalent setting in Vim.  It actually leaves the emacs
behaviour unchanged for compatibility with vanilla Emacs packages, and instead
redirects evil to work with a different variable for the current directory. I
originally had something that controlled the emacs default-directory variable
instead, but the current approach gives a smoother experience.

I'd love to hear your feedback. The repo can be found at

I think it would be great to have this as part of Evil, but I am not sure if
anyone else is interested in this aspect of compatibility with Vim.  If you
are, let me know!
Albert Krewinkel | 8 Sep 21:56 2014

Problem with parent keymap


I just encountered some unexpected behavior when defining key bindings
for maps which have parent maps:  When I define a key for some state for
the parent map as well as the child map, the child map overrides the
bindings for the parent map.

Here is what I mean:

    (defun alok-foo () (interactive) (message "foo"))
    (defun alok-bar () (interactive) (message "bar"))

    (defvar alok-mode-map (make-sparse-keymap))
    (defvar alok-child-mode-map
      (let ((map (make-sparse-keymap)))
        (set-keymap-parent map alok-mode-map)
        (define-key map (kbd "M-<return>") 'alok-bar)

    (define-derived-mode alok-mode prog-mode "ALOK"
      "Major ALOK mode")
    (define-derived-mode alok-child-mode alok-mode "calok"
      "ALOK derived mode")

    (evil-set-initial-state 'alok-mode 'motion)
    (evil-set-initial-state 'alok-child-mode 'motion)

    (evil-define-key 'motion alok-mode-map
      (kbd "f") 'alok-foo)
    (evil-define-key 'motion alok-child-mode-map
      (kbd "f") 'alok-bar)

When I enter into alok-mode and press `f`, I would ecpect to see "foo"
in the message area, but instead I get "bar".

I tried to find the reason for this myself, but I got stuck quickly.
Is there a way to work around this?

Thanks in advance!



Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124
Елена | 2 Sep 06:17 2014

Есть проблемы с сайтом? Мы поможем!

ТОЛЬКО ДО 15 сентяюря 2014 года!

1. Хостинг и домен в зоне RU на ваше имя на 1 год
2. Наполнение сайта текстом и фото (предоставляется заказчиком)
3. Форма отправки сообщений и карта проезда
4. Красивая фотогалерея
5. Создание 6-8 страниц сайта

Заказать сайт

(812) 981-72-40
(952) 368-65-21

info <at> el-sites.ru

Skype: el.sites


Если Вы хотите отписаться от рассылки, нажмите здесь
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Tad Ashlock | 24 Aug 16:29 2014

Issues Integrating Other Modes With Evil-Mode

I'm attempting to integrate org-mode with evil-mode.  I'm aware of the existing evil-org-mode, but what I'm attempting is much deeper.  Rather than just adding some evil keybindings to some org functions, I want
 the basic evil operations to work on org files.  That is, evil-mode operators, commands, and motions are org-aware.

I see that when evil-mode is in the normal state:

* the user presses 'x', which is bound to evil-delete-char
* evil-delete-char calls evil-delete
* evil-delete calls Emacs's delete-region to perform the deletion

When my new evil-org-mode (a minor mode) is active, I need evil-delete-char to call org-delete-char to perform the deletion.  Not directly, of course.  The following seems to work.

(defun evil-org-delete-region (beg end)
  (let ((N (- end beg)))
      (goto-char beg)
      (org-delete-char N))))

(evil-define-operator evil-org-delete-char (beg end type register)
  "Delete next character."
  :motion evil-forward-char
  (interactive "<R><x>")
  (cl-letf (((symbol-function 'delete-region) #'(lambda (beg end) (evil-org-delete-region beg end))))
    (evil-delete beg end type register)))

(define-key evil-org-mode-map [remap evil-delete-char] #'evil-org-delete-char)

Essentially, I remap evil-delete-char to evil-org-delete-char.  This new function temporarily redefines delete-region to be evil-org-delete-region, which, in turn, calls org-delete-char.  Then the subsequent cal
l to evil-delete will call org-delete-char with no changes to the evil-mode source code.  Great!  But...

(1) This approach gets more complicated for other evil-mode functions.

    * For example, evil-org-delete-backward-char-and-join requires more indirection in order to restore the function-cell value of delete-backward-char, because that's what the org-mode function needs to call.

    * Remapping a remapped binding doesn't chain.  And it appears that remapping a binding in my minor mode doesn't override the remapped binding that evil-mode does.  For example, if I remap delete-backward-cha
r in evil-org-mode, the evil-mode (insert state) binding (evil-delete-backward-char-and-join) still gets called.

    * I can't figure out how to intercept operators like "dd" (delete whole line), in order to override their low-level Emacs calls.

(2) This approach isn't composable.  That is, another minor mode could not integrate with evil-mode while evil-org-mode is active.


(1) Is there a good, clean, composable, way of doing what I'm trying to do?

(2) If not, is there an acceptable change that could be made to evil-mode to support what I'm trying to do?  A change that improves the ability to integrate with evil-mode in general, not just for my purpose?

If the answer to question (1) is 'no', I'm thinking the answer to question (2) might be something along the lines of replacing evil-mode's calls to fundamental Emacs text manipulation commands (like delete-regio
n) with (abnormal) hooks.  Each hook would default to being the command currently being called directly, but could be made buffer local and modified by another mode to support awareness of the buffer's contents.
  This would also allow, in theory, multiple modes to hook into the actions.  Although I can't quite picture how this would work cleanly in practice.

Thank you,
implementations-list mailing list
implementations-list <at> lists.ourproject.org
Linus Arver | 9 Aug 17:17 2014

cursor: make underlying letter bold


In GVim, when I move my cursor around in normal mode, the letter
underneath the cursor position becomes bolded.

Is there a simple way to do the same thing in Evil? Or, is this is more
of a syntax highlighting issue?

While I'm not a Lisp expert, I can see that my request involves
`evil-set-cursor` in evil-common.el...