summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
Diffstat (limited to 'init.org')
-rw-r--r--init.org53
1 files changed, 50 insertions, 3 deletions
diff --git a/init.org b/init.org
index 0038d01..64e47ea 100644
--- a/init.org
+++ b/init.org
@@ -808,6 +808,55 @@ TODO: the parentheses adjustments should happen only when I’m in programming m
<<show-paren-hook>>
#+END_SRC
+* God mode
+:PROPERTIES:
+:header-args: :noweb-ref god
+:END:
+
+#+BEGIN_SRC elisp
+(eval-after-load "god-mode"
+ '(progn
+ (defadvice god-mode-lookup-key-sequence (before my-swap-x-t)
+ "Swap ?x and ?t KEY arguments."
+ (case (ad-get-arg 0)
+ (?x (ad-set-arg 0 ?t))
+ (?t (ad-set-arg 0 ?x))))
+ (ad-activate 'god-mode-lookup-key-sequence)
+
+ (defvar original-color (frame-parameter nil 'cursor-color))
+ (defun my-update-cursor ()
+ (if god-local-mode
+ (set-cursor-color "Red")
+ (set-cursor-color original-color)))
+
+ (define-key god-local-mode-map (kbd ".") 'repeat)
+
+ (add-hook 'god-mode-enabled-hook 'my-update-cursor)
+ (add-hook 'god-mode-disabled-hook 'my-update-cursor)
+
+ ;; reliably toggle god-mode for all modes
+ (setq god-exempt-major-modes nil)
+ (setq god-exempt-predicates nil)
+
+ (defun god-toggle-on-overwrite ()
+ "Toggle god-mode on overwrite-mode."
+ (if (bound-and-true-p overwrite-mode)
+ (god-local-mode-pause)
+ (god-local-mode-resume)))
+
+ (add-hook 'overwrite-mode-hook 'god-toggle-on-overwrite)
+ (define-key god-local-mode-map (kbd "i") 'god-local-mode)
+
+ (global-set-key (kbd "C-x C-k") 'kill-this-buffer)
+ (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)))
+
+;; TODO: only do this on the Thinkpad
+(global-set-key (kbd "<mouse-3>") 'god-mode-all)
+#+END_SRC
+
* TODO Initial stuff
:PROPERTIES:
:header-args: :noweb-ref initial
@@ -976,9 +1025,6 @@ This is even more stuff to be done after initialising packages. I still need to
(load "init-my-stuff.el")
(load "init-paredit.el")
-(load "init-god-mode.el")
-(require 'my/init-god-mode)
-
;; Revert stale document graphics buffers automatically when the files
;; have changed.
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
@@ -1043,6 +1089,7 @@ Having defined named code blocks in the sections above we can finally put them a
<<tramp>>
<<shell>>
<<scheme>>
+<<god>>
<<ido-lazy>>
<<completion-lazy>>
<<pretty-symbols>>