I tried to use a following
(global-set-key (kbd "C-[") nil)
but it also disables M-x
. How can I properly disable it?
I tried to use a following
(global-set-key (kbd "C-[") nil)
but it also disables M-x
. How can I properly disable it?
See this answer, which should solve your problem.
A second possibility is to selectively remap this key combination for Emacs but outside Emacs. The options available for this will depend on your operating system. On Windows, you could do this with AutoHotkey pretty easily. If you're on Linux, you might take a look at this answer.
If you don't care about the Esc key per se, you may be able to sever the link between this pair of keys and Meta by setting meta-prefix-char
, but a little bit of fiddling around has convinced me that this isn't as straightforward as simply setting the variable.
Specifically, I tried setting meta-prefix-char
to nil. Following advice in @lawlist's comment on this question, I did so as early as possible in initialization to make sure all the keymaps got the hint, but some keybindings (most notably C-M-x
in lisp-interaction-mode
) were unexpectedly unbound, and I was getting many unexpected errors. It may be possible to sort all this out, but it's probably not worth the effort. Binding meta-prefix-char
to an alternative key will probably work better, but your options are limited to single ASCII characters, none of which seem more appealing to me than C-[
.