I have added:

(global-set-key (kbd "C-z") 'undo)

to my ~/.emacs file. But still when I press Ctrl+z nothing is undone even when I've had GNU Emacs open for a while and done several things in my present buffer. You can even see in my Edit menu that Undo isn't set to my desired keybinding: Ctrl+z.

Here is my ~/.emacs file, if relevant.

  • The edit menu doesn't show you every key sequence. What does C-h C-k C-z tell you? – icarus Dec 8 '16 at 5:59
  • This – Josh Pinto Dec 8 '16 at 6:05
  • Sorry, my mistake. I should have asked what does C-h k C-z tell you? Anyhow you have your solution, so no need to answer. – icarus Dec 8 '16 at 6:25

Turns out that it seems to be related to me still having a (cua-mode t) line in my ~/.emacs file. After I removed this line, the line:

(global-set-key (kbd "C-z") 'undo)

in my ~/.emacs file worked just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.