Compare commits
2 Commits
2b920ae743
...
f8ae2a6225
Author | SHA1 | Date | |
---|---|---|---|
f8ae2a6225 | |||
c5a6cb7833 |
37
init.el
37
init.el
@ -425,8 +425,8 @@ If the current window occupies the whole frame, split it."
|
|||||||
;; (eldoc 'nothing)
|
;; (eldoc 'nothing)
|
||||||
|
|
||||||
;; load evil or meow
|
;; load evil or meow
|
||||||
;; (require 'mir-evil)
|
(require 'mir-evil)
|
||||||
(require 'mir-meow)
|
;; (require 'mir-meow)
|
||||||
|
|
||||||
(use-package undo-fu
|
(use-package undo-fu
|
||||||
;; :after evil
|
;; :after evil
|
||||||
@ -1089,41 +1089,12 @@ Return nil if DIR is not in a hugo project at all."
|
|||||||
(use-package transient :ensure t)
|
(use-package transient :ensure t)
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:after seq
|
:after seq
|
||||||
:commands (madots magit-status magit)
|
:commands (magit-status magit)
|
||||||
:hook (magit-mode . turn-off-line-numbers)
|
:hook (magit-mode . turn-off-line-numbers)
|
||||||
:custom (vc-follow-symlinks t)
|
:custom (vc-follow-symlinks t)
|
||||||
(transient-history-file
|
(transient-history-file
|
||||||
(expand-file-name "transient/history.el" backup-directory))
|
(expand-file-name "transient/history.el" backup-directory))
|
||||||
:config
|
)
|
||||||
(defun madots--magit-buffers-p ()
|
|
||||||
(not (not ; converts all non-nil values to t
|
|
||||||
(remove nil ; clean useless elements
|
|
||||||
(mapcar (lambda (buffer)
|
|
||||||
(if (string-match-p "magit: " (buffer-name buffer))
|
|
||||||
buffer))
|
|
||||||
(buffer-list))))))
|
|
||||||
(defun madots--kill-all-magit-buffers ()
|
|
||||||
(mapcar (lambda (buffer)
|
|
||||||
(if (string-match-p "^magit" (buffer-name buffer))
|
|
||||||
(kill-buffer buffer)))
|
|
||||||
(buffer-list)))
|
|
||||||
(defun madots--cleanup ()
|
|
||||||
"Remove modifications made for `madots' once all magit buffers are killed."
|
|
||||||
(if (not (madots--magit-buffers-p))
|
|
||||||
(progn
|
|
||||||
(setq magit-git-executable madots--old-magit-exe)
|
|
||||||
(setq magit-bury-buffer-function madots--old-magit-bury-buf-func)
|
|
||||||
(cancel-function-timers #'madots--cleanup))))
|
|
||||||
(defun madots (&optional exe)
|
|
||||||
"Magit but with custom EXE, default \"dots\"."
|
|
||||||
(interactive)
|
|
||||||
(require 'magit)
|
|
||||||
(setq madots--old-magit-exe magit-git-executable)
|
|
||||||
(setq magit-git-executable (or exe "dots"))
|
|
||||||
(setq madots--old-magit-bury-buf-func magit-bury-buffer-function)
|
|
||||||
(setq magit-bury-buffer-function #'kill-buffer-and-window)
|
|
||||||
(magit-status)
|
|
||||||
(run-with-timer 5 3 #'madots--cleanup)))
|
|
||||||
;; ;; broken bc of hl-todo version issue
|
;; ;; broken bc of hl-todo version issue
|
||||||
;; (use-package magit-todos
|
;; (use-package magit-todos
|
||||||
;; :after magit
|
;; :after magit
|
||||||
|
Loading…
Reference in New Issue
Block a user