I just updated the emacs package elpy, and it's set the following keybindings:
<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 bound 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 my .emacs
, but no luck. How can I stop elpy-mode
from overriding these keys?
You can reset the offending mappings to nil
in one fell swoop in the following way. UPDATE. As per lunaryorn's comment, the file parameter should be "elpy"
rather than "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're not keen on the dolist
, you could wrap four calls to define-key
in a progn
within the eval-after-load
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With