I am using python with elpy mode which work fine, however I am really annoyed by the default which runs executes the command under the cursor whenever I press CTRL+ENTER since I keep pressing it accidentally. How do I disable this behavior? I tried
(global-set-key (kbd "<C-return>") nil)
but that does not seem to have an effect. Any help is much appreciated.
It's probably not set in the global key map, but in the major mode's map or some minor mode's map. In a buffer with the key bound, do C-h k C-<return>
to see the binding; it should show the key map that it's in. Then use define-key
to change it. E.g. if foo-mode-map
contains the binding, do
(define-key foo-mode-map (kbd "C-<return>") nil)
You will probably want to add that code to either a hook or wrap it in with-eval-after-load
, so foo-mode-map
is defined when it runs.