如何在Emacs中强制绑定? [英] How do I force a binding in Emacs?
问题描述
我试图绑定< C-return>
。我尝试了 global-set-key
,但是没有用。然后,我在 全局覆盖Emacs中的键绑定中找到了一个建议,其中有人创建了一个自定义的次要模式,其中包括它们的键绑定,例如:
I am trying to bind <C-return>
. I tried global-set-key
but it didn't work. I then found a suggestion in "Globally override key binding in Emacs" where someone created a custom minor-mode which included their keybindings, like this:
(define-key my-keys-minor-mode-map (kbd "<C-return>") 'insert-and-indent-line-above)
bit它仍然不会取代当前的绑定。如果我执行一个描述键
并按 C-Return
,它告诉我它绑定到 cua-set-rectangle-mark
。
Bit it still won't replace the current binding. If I do a describe-key
and press C-Return
it tells me that it is bound to cua-set-rectangle-mark
.
如何使此绑定取代所有其他绑定?
How do I make this binding supersede all other bindings?
推荐答案
听起来您有 cua-mode
已启用,这将设置该绑定。您可以禁用 cua-mode
:
(cua-mode -1)
或者,更改 cua-set-rectangle-mark <的绑定/ code>像这样:
Or, change the binding for cua-set-rectangle-mark
like so:
(setq cua-rectangle-mark-key (kbd "C-S-<return>"))
(cua-mode 1)
然后绑定应该生效(使用 global-set-key
)。
And then your binding should take effect (using the global-set-key
).
这篇关于如何在Emacs中强制绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!