Move Git related packages from configuration.org to init.el

This commit is contained in:
Gergely Polonkai 2025-06-03 17:31:38 +02:00
parent 395504b1ea
commit 1cadc1fd67
No known key found for this signature in database
GPG Key ID: 38F402C8471DDE93
2 changed files with 39 additions and 61 deletions

View File

@ -88,67 +88,6 @@ Rainbow to the stars…
("K" . dired-k)))
#+end_src
* Git related things
** ~magit~
#+begin_src emacs-lisp
(use-package magit
:custom
(magit-auto-revert-mode nil)
(magit-last-seen-setup-instructions "1.4.0")
:bind
(:map ctl-x-map
("g" . magit-status))
:hook
(git-commit-mode . turn-on-flyspell))
#+end_src
** ~forge~ to make Magit work with Git forges
#+begin_src emacs-lisp
(use-package forge)
#+end_src
** ~git-gutter~ to see changed lines
In graphical mode we use ~git-gutter-finge~, ~git-gutter~ otherwise (as we have no fringe in that case).
It also provides some nice commands to navigate between change sets.
#+begin_src emacs-lisp
(let ((gitgutter-package
(if (display-graphic-p)
"git-gutter-fringe"
"git-gutter")))
(eval `(use-package ,gitgutter-package
:demand
:config
(global-git-gutter-mode t)
:bind
(:map gpolonkai/pers-map
("gg" . git-gutter:update-all-windows)
("gn" . git-gutter:next-hunk)
("gp" . git-gutter:previous-hunk)))))
#+end_src
** ~git-messenger~, aka annotate current line
#+begin_src emacs-lisp
(use-package git-messenger
:bind
(:map gpolonkai/pers-map
("gm" . git-messenger:popup-message)))
#+end_src
** ~git-timemachine~, to see previous versions of the current file
#+begin_src emacs-lisp
(use-package git-timemachine
:bind
(([f6] . git-timemachine-toggle)))
#+end_src
* Completion related external packages
** ~vertico~

39
init.el
View File

@ -1206,6 +1206,45 @@ order."
(use-package orgit-forge
:after magit org orgit)
;; Git related things
(use-package magit
:custom
(magit-auto-revert-mode nil)
(magit-last-seen-setup-instructions "1.4.0")
:bind
(:map ctl-x-map
("g" . magit-status))
:hook
(git-commit-mode . turn-on-flyspell))
(use-package forge)
;; In graphical mode we use ~git-gutter-finge~, ~git-gutter~ otherwise (as we have no fringe in that case).
(let ((gitgutter-package
(if (display-graphic-p)
"git-gutter-fringe"
"git-gutter")))
(eval `(use-package ,gitgutter-package
:demand
:config
(global-git-gutter-mode t)
:bind
(:map gpolonkai/pers-map
("gg" . git-gutter:update-all-windows)
("gn" . git-gutter:next-hunk)
("gp" . git-gutter:previous-hunk)))))
(use-package git-messenger
:bind
(:map gpolonkai/pers-map
("gm" . git-messenger:popup-message)))
(use-package git-timemachine
:bind
(([f6] . git-timemachine-toggle)))
;; I started moving my configuration to this Org file. Its easier to document this way.
(org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))