I've created a custom key binding macro as follows:
(global-set-key (kbd "C-C C-c") "\C-a\C- \C-n\M-w\C-y")
The problem is that C-c C-c
is defined for python-send-buffer
in python-mode
. So my macro works for all modes except python-mode. I am assuming that python-mode
is evaluated after my init file, so it overwrites that keybinding.
I tried unsetting C-c C-c
using (eval-after-load "python-mode")
and using global-unset-key
but that doesn't work. C-c C-c
in python is always mapping to python-send-buffer
.
How can I completely disable Python's C-c C-c
, and use my macro instead?
I am using Emacs 24.2.1.
Keys can be bound to commands either interactively or in your . emacs file. To interactively bind keys for all modes, type M-x global-set-key RET key cmd RET . To bind a key just in the current major mode, type M-x local-set-key RET key cmd RET .
(add-hook 'python-mode-hook
(lambda()
(local-unset-key (kbd "C-c C-c"))))
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