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 evil-insert-state-map evil-emacs-state-map)) (define-key (eval map) "\C-w" nil))) (eval-after-load "evil-maps" (dolist (map '(evil-motion-state-map evil-insert-state-map evil-emacs-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.
On Tue, Sep 23 2014 (20:36), RC <[email protected]> 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
Thanks for your help. I have implemented the change you suggested to unbind C-w. When I do C-h k C-SPC it shows C-SPC- in the minbuffer, indicating that C-SPC has been set as a prefix key. After checking some more it seems to arise from the fact that I am using SPC as my leader, so in insert mode, C-SPC seems to be working like a leader key, although I may be completely off-base here. On Tue, Sep 23, 2014 at 6:27 PM, Michael Markert <[email protected]> wrote:
On Tue, Sep 23 2014 (20:36), RC <[email protected]> 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
On Tue, Sep 23 2014 (18:55), RCY <[email protected]> wrote:
When I do C-h k C-SPC it shows C-SPC- in the minbuffer, indicating that C-SPC has been set as a prefix key. After checking some more it seems to arise from the fact that I am using SPC as my leader, so in insert mode, C-SPC seems to be working like a leader key, although I may be completely off-base here.
Could it be you are using evil-leader with (setq evil-leader/in-all-states t) ? That would result into C-SPC being bound in insert (and emacs) state unless you also changed `evil-leader/non-normal-prefix'. To use the same leader in all states you can do: (setq evil-leader/non-normal-prefix "") But that's probably problematic in emacs state. Michael
participants (3)
-
Michael Markert -
RC -
RCY