Remap C-SPC binding

Michael Markert markert.michael at gmail.com
Wed Sep 24 00:27:45 CEST 2014


On Tue, Sep 23 2014 (20:36), RC <recif at yahoo.com> wrote: 

> 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.

C-w is bound to the window map,

    (define-key evil-motion-state-map (kbd "C-w") nil)
    
should fix that for you.

C-SPC, however, is not bound in any state. What does `C-h k C-SPC`
report?

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

And this is broken, it will be evaluated right away, not after loading
evil. You need to quote the form:

    (eval-after-load "evil-maps"
      '(dolist (map '(evil-motion-state-map
                      evil-insert-state-map
                      evil-emacs-state-map))
        (define-key (eval map) "\C-w" nil)))
        
And using `list' instead of a quote makes `eval' unnecessary:

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




More information about the implementations-list mailing list