Reputation: 11
I was unsetting the C-z quit shortcut in my Emacs. I accidentally made a typo, and somehow made it so that I couldn't capitalize the letter C. In an effort to try to restore this, I accidentally unset C-y, and then accidentally set it back to "undo" instead of "paste". Then I accidentally unset the letter "c" completely.
My Emacs is in a mess right now. How can I just reset these keys to their default commands?
For reference, I am running on EC2 with AMI 5.10. I also could not find an existing Emacs init file in any of the standard locations.
Upvotes: 1
Views: 732
Reputation: 73345
There's no "reset all the keys" command (and for numerous reasons it wouldn't make any sense to include one), but if you don't want to restart your existing instance, then do this:
For the global keymap you can use M-x global-set-key
More generally, evaluate the code (define-key KEYMAP (kbd "KEY SEQUENCE") #'COMMAND)
for the KEYMAP name indicated in the *Help* buffer. E.g. if I saw:
C-y runs the command yank (found in global-map)
Then (because it's the global keymap) I could use either of these:
(define-key global-map (kbd "C-y") #'yank)
global-set-key
RET C-y yank
RETUpvotes: 1