git: Move to own configuration for (ma)git

Magit is now configured together with all git related config that may
possibily come in the future.
This commit is contained in:
finga 2024-05-27 13:57:32 +02:00
parent 0e7dd9da5f
commit 8bb1b07590
4 changed files with 20 additions and 20 deletions

View file

@ -1,22 +1,3 @@
;; magit
(use-package magit
:ensure t
:init
;; (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el)
(defun vcsh (repo)
"Invoke magit on a vcsh repo. This requires an appropriate entry in `tramp-methods'."
(interactive (let ((repos (delq nil
(mapcar #'(lambda (name)
(if (string-match ".git$" name)
(substring name 0 -4)
nil))
(directory-files "~/.config/vcsh/repo.d")))))
(list (completing-read "Repository: " repos nil t))))
(magit-status-internal (format "/vcsh:%s:" repo)))
:config
;; Turn on flyspell when writing commit messages
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell))
;; paredit ;; paredit
(use-package paredit (use-package paredit
:ensure t :ensure t

18
.emacs.d/config/git.el Normal file
View file

@ -0,0 +1,18 @@
;; magit
(use-package magit
:ensure t
:init
;; (taken from :open https://r0tty.org/git/dotfiles/emacs/tree/.emacs.d/config/development.el)
(defun vcsh (repo)
"Invoke magit on a vcsh repo. This requires an appropriate entry in `tramp-methods'."
(interactive (let ((repos (delq nil
(mapcar #'(lambda (name)
(if (string-match ".git$" name)
(substring name 0 -4)
nil))
(directory-files "~/.config/vcsh/repo.d")))))
(list (completing-read "Repository: " repos nil t))))
(magit-status-internal (format "/vcsh:%s:" repo)))
:config
;; Turn on flyspell when writing commit messages
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell))

View file

@ -57,7 +57,7 @@ symbols, which are converted to strings, and suffixed with \".el\"."
:group 'config-snippets :group 'config-snippets
:type '(repeat directory)) :type '(repeat directory))
(setq config-snippets '(base backups c calendar dev functions gpg org pass ripgrep rust wl yaml)) (setq config-snippets '(base backups c calendar dev functions git gpg org pass ripgrep rust wl yaml))
(message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path) (message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path)
(dolist (snippet config-snippets) (dolist (snippet config-snippets)

View file

@ -5,6 +5,7 @@
!/.emacs.d/config/c.el !/.emacs.d/config/c.el
!/.emacs.d/config/dev.el !/.emacs.d/config/dev.el
!/.emacs.d/config/functions.el !/.emacs.d/config/functions.el
!/.emacs.d/config/git.el
!/.emacs.d/config/gpg.el !/.emacs.d/config/gpg.el
!/.emacs.d/config/org.el !/.emacs.d/config/org.el
!/.emacs.d/config/pass.el !/.emacs.d/config/pass.el