diff --git a/configuration.org b/configuration.org index 563b282..f8c5589 100644 --- a/configuration.org +++ b/configuration.org @@ -1837,6 +1837,67 @@ 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 + * Custom commands and functions ** Frame manipulation @@ -1974,27 +2035,6 @@ Let’s see if i can get my brain more organised this way… (c-mode-common . gpolonkai/cond-enable-ggtags-mode)) #+END_SRC -** 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 - -*** Make Magit work with Git forges - -#+BEGIN_SRC emacs-lisp -(use-package forge) -#+END_SRC - ** Secretaria Because even secretaries need a secretary today. @@ -2705,51 +2745,6 @@ This is a big one; I use a lot of customisation here. (org-clock-waybar-setup)) #+end_src -* Git & Co. - -** Git status on the fringe - -In graphical modes we use ~git-gutter-fringe~, and ~git-gutter~ otherwise. - -#+BEGIN_SRC emacs-lisp -;; Git gutter -;; If we are in text-only mode, there is no fringe. -(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 blame current line. - -#+BEGIN_SRC emacs-lisp -(use-package git-messenger - :bind - (:map gpolonkai/pers-map - ("gm" . git-messenger:popup-message))) -#+END_SRC - -** Git time machine - -See previous versions of the current file. - -#+BEGIN_SRC emacs-lisp -(use-package git-timemachine - :bind - (([f6] . git-timemachine-toggle))) -#+END_SRC - * Consult, Vertico, Orderless The new completing system!