Skip to content

Instantly share code, notes, and snippets.

@rksm
Created September 24, 2018 19:24
Show Gist options
  • Save rksm/b287ed149594689f41e9a04c11607d2a to your computer and use it in GitHub Desktop.
Save rksm/b287ed149594689f41e9a04c11607d2a to your computer and use it in GitHub Desktop.
god-mode setup
(use-package god-mode
:after which-key multiple-cursors
:ensure
:config
(define-key god-local-mode-map (kbd ".") 'repeat)
(global-set-key (kbd "<escape>") 'god-mode-all)
(define-key mc/keymap (kbd "<escape>") 'god-mode-all)
(which-key-enable-god-mode-support)
(setq rk/god-orig-mode-line-bg (face-background 'mode-line))
(setq rk/god-orig-mode-line-inactive-bg (face-background 'mode-line-inactive))
(run-with-idle-timer 2 nil (lambda ()
(setq rk/god-orig-mode-line-bg (face-background 'mode-line))
(setq rk/god-orig-mode-line-inactive-bg (face-background 'mode-line-inactive))))
(add-hook 'god-mode-enabled-hook 'rk/god-mode-update-mode-line)
(add-hook 'god-mode-disabled-hook 'rk/god-mode-update-mode-line)
(require 'god-mode-isearch)
(define-key isearch-mode-map (kbd "<escape>") 'god-mode-isearch-activate)
(define-key god-mode-isearch-map (kbd "<escape>") 'god-mode-isearch-disable)
(define-key god-mode-isearch-map (kbd "o") 'rk/occur-from-isearch))
(defun rk/god-update-cursor ()
(setq cursor-type (if (or god-local-mode buffer-read-only)
'box
'bar)))
(defun rk/god-mode-update-mode-line ()
(let ((limited-colors-p (> 257 (length (defined-colors)))))
(cond (god-local-mode (progn
(set-face-background 'mode-line "dark red")
(set-face-background 'mode-line-inactive "dark red")))
(t (progn
(set-face-background 'mode-line rk/god-orig-mode-line-bg)
(set-face-background 'mode-line-inactive rk/god-orig-mode-line-bg))))))
;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment