How to force binding in Emacs?

I'm trying to tie <C-return>. I tried global-set-key, but it did not work. Then I found a sentence in “ globally override key bindings in Emacs ”, where someone created a custom minor mode that included their key bindings, for example:

(define-key my-keys-minor-mode-map (kbd "<C-return>") 'insert-and-indent-line-above)

A bit will not replace the current binding anyway. If I do describe-keyand click C-Return, he informs me that he is attached to cua-set-rectangle-mark.

How do I make this binding replace all other bindings?

+3
source share
2 answers

It looks like you turned cua-modeon that sets this binding. You can disable cua-mode:

(cua-mode -1)

cua-set-rectangle-mark :

(setq cua-rectangle-mark-key (kbd "C-S-<return>"))
(cua-mode 1)

( global-set-key).

+8

global-unset-key.

(global-unset-key (read-kbd-macro "C-<return>"))
0

Source: https://habr.com/ru/post/1765600/


All Articles