diff --git a/configuration.org b/configuration.org index 30844d8..f5e094b 100644 --- a/configuration.org +++ b/configuration.org @@ -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~ diff --git a/init.el b/init.el index 2a0f9a3..e990d88 100644 --- a/init.el +++ b/init.el @@ -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. It’s easier to document this way. (org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))