How can I stop elpy from overriding some of my key bindings?
I just updated my emacs elpy package and installed the following key bindings:
<M-down> elpy-nav-move-iblock-down
<M-left> elpy-nav-move-iblock-left
<M-right> elpy-nav-move-iblock-right
<M-up> elpy-nav-move-iblock-up
I usually have these keys tied to windmove-<direction>
, and I think this is a real pain. Following this github issue I tried:
(load "python")
(define-key elpy-mode-map [remap windmove-left] nil)
(define-key elpy-mode-map [remap windmove-right] nil)
(define-key elpy-mode-map [remap windmove-down] nil)
(define-key elpy-mode-map [remap windmove-up] nil)
in mine .emacs
, but no luck. How do I stop elpy-mode
these keys from overriding?
source to share
You can reset the offending collations in nil
one fell swoop like this. UPDATE. As per lunaryorn's comment, the file parameter should be "elpy"
, not "python"
which is now reflected in the answer.
(eval-after-load "elpy"
'(cl-dolist (key '("M-<up>" "M-<down>" "M-<left>" "M-<right>"))
(define-key elpy-mode-map (kbd key) nil)))
If you are not interested in dolist
, you can wrap the four calls define-key
in progn
between eval-after-load
.
source to share