Last active
May 10, 2020 20:36
-
-
Save federkamm/6bb3e0b55157fe0d995fd9bc4e1947e7 to your computer and use it in GitHub Desktop.
Single shot god-mode for Emacs: Activate god-mode for just one command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package god-mode | |
:ensure t | |
:config | |
(defun god-mode-deactivate-and-remove-hook () | |
(god-local-mode -1) | |
(remove-hook 'post-command-hook #'god-mode-deactivate-and-remove-hook)) | |
(defun god-mode-single-shot () | |
(interactive) | |
(god-local-mode 1) | |
(add-hook 'pre-command-hook #'god-mode-deactivate-and-remove-hook)) | |
:bind ("C-z" . god-mode-single-shot)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment