summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-03-30 01:42:22 -0400
committerKyle Meyer <kyle@kyleam.com>2015-03-30 01:43:22 -0400
commit5c9589128f543649a37e61e96bc6e4e1831a821c (patch)
treef25ea978f04520e46494c93bded6a16442701071
parentb6282c81f42327147da31650e3eff38e704ddbce (diff)
downloademacs.d-5c9589128f543649a37e61e96bc6e4e1831a821c.tar.gz
Install God mode
-rw-r--r--Cask1
-rw-r--r--init.el1
-rw-r--r--lisp/init-god.el46
3 files changed, 48 insertions, 0 deletions
diff --git a/Cask b/Cask
index 6f19ea1..02ad5f7 100644
--- a/Cask
+++ b/Cask
@@ -20,6 +20,7 @@
(depends-on "gitattributes-mode")
(depends-on "gitconfig-mode")
(depends-on "gitignore-mode")
+(depends-on "god-mode")
(depends-on "haskell-mode")
(depends-on "helm")
(depends-on "helm-projectile")
diff --git a/init.el b/init.el
index 3add1e2..0496b7f 100644
--- a/init.el
+++ b/init.el
@@ -27,6 +27,7 @@
(require 'init-view)
(require 'init-editing)
+(require 'init-god)
(require 'init-text)
(require 'init-elisp)
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)
+