Replace god-mode with devil
This commit is contained in:
parent
7541c3e54f
commit
bd8ae57367
46
init.el
46
init.el
|
@ -53,54 +53,20 @@
|
|||
(global-set-key (kbd "C-/") #'undo-fu-only-undo)
|
||||
(global-set-key (kbd "C-?") #'undo-fu-only-redo))
|
||||
|
||||
(use-package god-mode
|
||||
(use-package devil
|
||||
:demand t
|
||||
:bind
|
||||
("<escape>" . god-mode-all)
|
||||
("ESC ESC ESC" . god-mode-all)
|
||||
("C-S-h" . help-command)
|
||||
("C-h" . my--god-del)
|
||||
(:map god-local-mode-map
|
||||
("i" . god-mode-all)
|
||||
("<escape>" . my--god-c-g)
|
||||
("ESC ESC ESC" . keyboard-escape-quit)
|
||||
("z" . repeat)
|
||||
("q" . my--god-c-q))
|
||||
(:map minibuffer-local-map
|
||||
("<escape>" . abort-minibuffers)
|
||||
("ESC ESC ESC" . keyboard-escape-quit))
|
||||
:custom
|
||||
(god-exempt-major-modes nil)
|
||||
(god-exempt-predicates (list #'god-exempt-mode-p))
|
||||
(god-mode-enable-function-key-translations nil)
|
||||
("C-h" . my--devil-del)
|
||||
:config
|
||||
(defun my--god-c-q ()
|
||||
(interactive)
|
||||
(let ((god-local-mode nil))
|
||||
(if-let* ((buffer-read-only)
|
||||
(ret (key-binding (read-kbd-macro "q")))
|
||||
((not (or (eq ret #'self-insert-command) (and (boundp lispy-mode) lispy-mode)))))
|
||||
(call-interactively ret)
|
||||
(switch-to-prev-buffer))))
|
||||
(cl-macrolet ((define-kmacro-wrapper (name key)
|
||||
`(defun ,name ()
|
||||
(interactive)
|
||||
(call-interactively (key-binding (read-kbd-macro ,key))))))
|
||||
(define-kmacro-wrapper my--god-del "DEL")
|
||||
(define-kmacro-wrapper my--god-c-g "C-g"))
|
||||
(with-eval-after-load 'catppuccin-theme
|
||||
(add-hook 'god-mode-enabled-hook
|
||||
(lambda ()
|
||||
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'rosewater)))))
|
||||
(unless (display-graphic-p)
|
||||
(send-string-to-terminal "\e[2 q"))))
|
||||
(add-hook 'god-mode-disabled-hook
|
||||
(lambda ()
|
||||
(face-spec-set 'cursor `((t (:background ,(catppuccin-get-color 'mauve)))))
|
||||
(unless (display-graphic-p)
|
||||
;; Escape codes for hbar cursor in insert mode
|
||||
(send-string-to-terminal "\e[4 q")))))
|
||||
(god-mode))
|
||||
(define-kmacro-wrapper my--devil-del "DEL"))
|
||||
(add-to-list 'devil-repeatable-keys '("%k v"))
|
||||
(add-to-list 'devil-repeatable-keys '("%k m v"))
|
||||
(global-devil-mode))
|
||||
|
||||
(use-package multiple-cursors
|
||||
:bind
|
||||
|
|
Loading…
Reference in a new issue