Skip to main content
2 of 3
added 251 characters in body
clemera
  • 3.5k
  • 15
  • 41

You can do (define-key key-translation-map (kbd "ESC") (kbd "C-g")). I did the same a long time ago and had no problems.

Edit to improve the answer according to the comments:

If you want to keep the ESC key functionality, you can do (define-key key-translation-map (kbd "C-<escape>") (kbd "ESC"))

One thing to note is that if Emacs hangs you still have to use the C-g key for some reason, but that happens rarely.

clemera
  • 3.5k
  • 15
  • 41