mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-13 23:51:34 +09:00
emacs : magit
This commit is contained in:
@ -94,7 +94,7 @@ Otherwise the startup will be very slow. "
|
|||||||
(require 'init-utils)
|
(require 'init-utils)
|
||||||
|
|
||||||
;; Programming
|
;; Programming
|
||||||
;;(require 'init-vcs)
|
(require 'init-vcs)
|
||||||
;;(require 'init-flycheck)
|
;;(require 'init-flycheck)
|
||||||
;;(require 'init-eglot)
|
;;(require 'init-eglot)
|
||||||
;;(require 'init-ctags)
|
;;(require 'init-ctags)
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
;; Git
|
;; Git
|
||||||
;; See `magit-maybe-define-global-key-bindings'
|
;; See `magit-maybe-define-global-key-bindings'
|
||||||
(use-package magit
|
(use-package magit
|
||||||
|
:ensure nil
|
||||||
:commands (magit-status magit-get-current-branch)
|
:commands (magit-status magit-get-current-branch)
|
||||||
:init (setq magit-diff-refine-hunk t)
|
:init (setq magit-diff-refine-hunk t)
|
||||||
:config
|
:config
|
||||||
@ -27,50 +28,58 @@
|
|||||||
(bury-buffer buf)
|
(bury-buffer buf)
|
||||||
(kill-buffer buf))))
|
(kill-buffer buf))))
|
||||||
buffers))))
|
buffers))))
|
||||||
(setq magit-bury-buffer-function #'my-magit-kill-buffers))
|
(setq magit-bury-buffer-function #'my-magit-kill-buffers)))
|
||||||
|
|
||||||
;; Show TODOs in magit
|
;; Show TODOs in magit
|
||||||
(use-package magit-todos
|
(use-package magit-todos
|
||||||
:defines magit-todos-nice
|
:straight t
|
||||||
:commands magit-todos--scan-with-git-grep
|
:ensure t
|
||||||
:init
|
:defines magit-todos-nice
|
||||||
(setq magit-todos-nice (if (executable-find "nice") t nil))
|
:commands magit-todos--scan-with-git-grep
|
||||||
(setq magit-todos-scanner #'magit-todos--scan-with-git-grep)
|
:init
|
||||||
(setq magit-todos-exclude-globs '(".git/" "*.json" "*.js"))
|
(setq magit-todos-nice (if (executable-find "nice") t nil))
|
||||||
(let ((inhibit-message t))
|
(setq magit-todos-scanner #'magit-todos--scan-with-git-grep)
|
||||||
(magit-todos-mode 1))))
|
(setq magit-todos-exclude-globs '(".git/" "*.json" "*.js"))
|
||||||
|
(let ((inhibit-message t))
|
||||||
|
(magit-todos-mode 1)))
|
||||||
|
|
||||||
;; Walk through git revisions of a file
|
;; Walk through git revisions of a file
|
||||||
(use-package git-timemachine
|
(use-package git-timemachine
|
||||||
|
:straight t
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
:custom-face
|
:custom-face
|
||||||
(git-timemachine-minibuffer-author-face ((t (:inherit success :foreground unspecified))))
|
(git-timemachine-minibuffer-author-face ((t (:inherit success :foreground unspecified))))
|
||||||
(git-timemachine-minibuffer-detail-face ((t (:inherit warning :foreground unspecified))))
|
(git-timemachine-minibuffer-detail-face ((t (:inherit warning :foreground unspecified))))
|
||||||
:hook ((git-timemachine-mode . (lambda ()
|
:hook ((git-timemachine-mode
|
||||||
"Improve `git-timemachine' buffers."
|
. (lambda ()
|
||||||
;; Display different colors in mode-line
|
"Improve `git-timemachine' buffers."
|
||||||
(if (facep 'mode-line-active)
|
;; Display different colors in mode-line
|
||||||
(face-remap-add-relative 'mode-line-active 'custom-state)
|
(if (facep 'mode-line-active)
|
||||||
(face-remap-add-relative 'mode-line 'custom-state))
|
(face-remap-add-relative 'mode-line-active 'custom-state)
|
||||||
|
(face-remap-add-relative 'mode-line 'custom-state))
|
||||||
|
|
||||||
;; Highlight symbols in elisp
|
;; Highlight symbols in elisp
|
||||||
(and (derived-mode-p 'emacs-lisp-mode)
|
(and (derived-mode-p 'emacs-lisp-mode)
|
||||||
(fboundp 'highlight-defined-mode)
|
(fboundp 'highlight-defined-mode)
|
||||||
(highlight-defined-mode t))
|
(highlight-defined-mode t))
|
||||||
|
|
||||||
;; Display line numbers
|
;; Display line numbers
|
||||||
(and (derived-mode-p 'prog-mode 'yaml-mode)
|
(and (derived-mode-p 'prog-mode 'yaml-mode)
|
||||||
(fboundp 'display-line-numbers-mode)
|
(fboundp 'display-line-numbers-mode)
|
||||||
(display-line-numbers-mode t))))
|
(display-line-numbers-mode t))))
|
||||||
(before-revert . (lambda ()
|
(before-revert . (lambda ()
|
||||||
(when (bound-and-true-p git-timemachine-mode)
|
(when (bound-and-true-p git-timemachine-mode)
|
||||||
(user-error "Cannot revert the timemachine buffer"))))))
|
(user-error "Cannot revert the timemachine buffer"))))))
|
||||||
;; Resolve diff3 conflicts
|
;; Resolve diff3 conflicts
|
||||||
(use-package smerge-mode
|
(use-package smerge-mode
|
||||||
:ensure nil
|
:straight t
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
:diminish
|
:diminish
|
||||||
:pretty-hydra
|
:pretty-hydra
|
||||||
((:title (pretty-hydra-title "Smerge" 'octicon "nf-oct-diff")
|
((:title (pretty-hydra-title "Smerge" 'octicon "nf-oct-diff")
|
||||||
:color pink :quit-key ("q" "C-g"))
|
:color pink :quit-key ("q" "C-g"))
|
||||||
("Move"
|
("Move"
|
||||||
(("n" smerge-next "next")
|
(("n" smerge-next "next")
|
||||||
("p" smerge-prev "previous"))
|
("p" smerge-prev "previous"))
|
||||||
@ -97,7 +106,7 @@
|
|||||||
(bury-buffer))
|
(bury-buffer))
|
||||||
"Save and bury buffer" :exit t))))
|
"Save and bury buffer" :exit t))))
|
||||||
:bind (:map smerge-mode-map
|
:bind (:map smerge-mode-map
|
||||||
("C-c m" . smerge-mode-hydra/body))
|
("C-c m" . smerge-mode-hydra/body))
|
||||||
:hook ((find-file . (lambda ()
|
:hook ((find-file . (lambda ()
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
@ -108,11 +117,17 @@
|
|||||||
(smerge-mode-hydra/body))))))
|
(smerge-mode-hydra/body))))))
|
||||||
;; Open github/gitlab/bitbucket page
|
;; Open github/gitlab/bitbucket page
|
||||||
(use-package browse-at-remote
|
(use-package browse-at-remote
|
||||||
|
:straight t
|
||||||
|
:ensure t
|
||||||
|
:defer t
|
||||||
:bind (:map vc-prefix-map
|
:bind (:map vc-prefix-map
|
||||||
("B" . browse-at-remote)))
|
("B" . browse-at-remote)))
|
||||||
|
|
||||||
;; Git configuration modes
|
;; Git configuration modes (ex: gitignore gitattributes gitconfig)
|
||||||
(use-package git-modes)
|
(use-package git-modes
|
||||||
|
:straight t
|
||||||
|
:ensure t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-vcs)
|
(provide 'init-vcs)
|
||||||
|
|||||||
Reference in New Issue
Block a user