summaryrefslogtreecommitdiff
diff options
context:
space:
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)
+