diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-03-30 01:42:22 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-03-30 01:43:22 -0400 |
commit | 5c9589128f543649a37e61e96bc6e4e1831a821c (patch) | |
tree | f25ea978f04520e46494c93bded6a16442701071 /lisp | |
parent | b6282c81f42327147da31650e3eff38e704ddbce (diff) | |
download | emacs.d-5c9589128f543649a37e61e96bc6e4e1831a821c.tar.gz |
Install God mode
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-god.el | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lisp/init-god.el b/lisp/init-god.el new file mode 100644 index 0000000..5ccb00d --- /dev/null +++ b/lisp/init-god.el @@ -0,0 +1,46 @@ +(require 'god-mode) + +(defvar km/god-exempt-major-modes + '(gnus-group-mode + gnus-summary-mode + gnus-article-mode + message-mode + magit-popup-mode + magit-popup-sequence-mode)) + +(setq god-exempt-major-modes + (append km/god-exempt-major-modes god-exempt-major-modes)) + +;; `god-exempt-major-modes' can't be used here because buffer is in +;; `text mode'. +(add-hook 'git-commit-setup-hook (lambda () (god-local-mode -1))) + +(add-hook 'view-mode-hook (lambda () + (if view-mode + (god-local-mode-pause) + (god-local-mode-resume)))) + +(add-hook 'org-capture-mode-hook (lambda () (god-local-mode -1))) + +(add-hook 'god-mode-enabled-hook (lambda () + (when view-mode + (view-mode -1)))) + +(add-hook 'god-mode-enabled-hook 'km/god-update-cursor) +(add-hook 'god-mode-disabled-hook 'km/god-update-cursor) + +(defun km/god-update-cursor () + (setq cursor-type (if god-local-mode 'bar 'box))) + +(global-set-key (kbd "C-c d") 'god-local-mode) + +(define-key god-local-mode-map "." 'repeat) +(define-key god-local-mode-map "i" 'god-local-mode) + +(global-set-key (kbd "C-x C-1") 'delete-other-windows) +(global-set-key (kbd "C-x C-2") 'split-window-below) +(global-set-key (kbd "C-x C-3") 'split-window-right) +(global-set-key (kbd "C-x C-0") 'delete-window) + +(provide 'init-god) + |