I am a fairly new emacs user and would appreciate any help you could offer.

I have recently installed the evil mode package onto my emacs. The package itself works perfectly, however, the default toggle binding C-z is not working as expected. When outside of evil mode it minimises the current frame. If I invoke evil mode through M-x RET evil-mode then input C-z, it will toggle back as expected.

I have attempted a fix by adding the following to my init.el file in an attempt to overwrite the existing key binding:

(setq evil-toggle-key "C-z")
(require 'evil)

I have also tried

(global-unset-key (kbd "C-z"))

alone and in conjunction with the previous but this seems to completely unbind the key chord.

Does anyone have a solution which changes C-z from 'minimise frame' to 'toggle evil mode'?


A combination of those works - just unbind the global key first.

(global-unset-key (kbd "C-z"))
(require 'evil)
(setq evil-toggle-key "C-z")
(evil-mode 1)

Until evil-mode is activated, the key binding does not work. I assume you have evil-mode started by default, so the above should suit your workflow.

| improve this answer | |
  • 1
    Thank you very much! This is perfect. I was not expecting to have got so close to the solution before posting. – FoxCharles May 24 at 19:42

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.