2021-02-20 11:40:03 +00:00
|
|
|
;; Magit!
|
|
|
|
(use-package magit
|
2021-02-20 19:58:31 +00:00
|
|
|
:commands (magit-status
|
|
|
|
magit-file-dispatch
|
|
|
|
magit-dispatch
|
|
|
|
magit-name-local-branch)
|
2021-02-20 16:12:26 +00:00
|
|
|
:init
|
|
|
|
(leader-def-key "g" '(nil :which-key "git"))
|
2021-02-20 11:40:03 +00:00
|
|
|
:config
|
|
|
|
(evil-collection-magit-setup)
|
2021-02-20 16:53:40 +00:00
|
|
|
(add-hook 'magit-mode-hook #'hl-line-mode)
|
2021-02-20 11:40:03 +00:00
|
|
|
:general
|
2021-02-20 16:12:26 +00:00
|
|
|
(leader-map "gs" #'magit-status
|
2021-02-20 11:40:03 +00:00
|
|
|
"gg" #'magit-file-dispatch
|
|
|
|
"gd" #'magit-dispatch))
|
|
|
|
|
2021-02-20 15:44:56 +00:00
|
|
|
;; git-link makes it easy to copy the GitHub URL of the current file/line
|
|
|
|
(use-package git-link
|
|
|
|
:commands (git-link git-link-commit)
|
|
|
|
:init
|
|
|
|
(defun git-link-browse ()
|
|
|
|
(interactive)
|
|
|
|
(let ((git-link-open-in-browser t))
|
|
|
|
(call-interactively 'git-link)))
|
|
|
|
(defun git-link-browse-commit ()
|
|
|
|
(interactive)
|
|
|
|
(let ((git-link-open-in-browser t))
|
|
|
|
(call-interactively 'git-link-commit)))
|
|
|
|
:config
|
|
|
|
(add-to-list 'git-link-remote-alist '("git.jeremydormitzer.com" git-link-bitbucket))
|
|
|
|
(add-to-list 'git-link-commit-remote-alist '("git.jeremydormitzer.com" git-link-commit-bitbucket))
|
|
|
|
:general
|
|
|
|
(leader-map "gy" #'git-link
|
|
|
|
"gl" #'git-link-browse
|
|
|
|
"gc" #'git-link-commit
|
|
|
|
"gb" #'git-link-browse-commit))
|
|
|
|
|
2021-02-20 16:12:26 +00:00
|
|
|
;; Interact with GitHub etc. from Magit
|
|
|
|
(use-package forge
|
2021-02-20 16:23:16 +00:00
|
|
|
:after magit
|
|
|
|
:config
|
|
|
|
(add-to-list 'forge-alist '("git.jeremydormitzer.com"
|
|
|
|
"git.jeremydormitzer.com/api/v1"
|
|
|
|
"git.jeremydormitzer.com"
|
|
|
|
forge-gitea-repository))
|
|
|
|
:custom
|
|
|
|
(forge-owned-accounts '((jdormit . (remote-name "jdormit"))))
|
|
|
|
:general
|
|
|
|
(normal magit-mode-map "yu" #'forge-copy-url-at-point-as-kill))
|
2021-02-20 16:12:26 +00:00
|
|
|
|
2021-02-20 11:40:03 +00:00
|
|
|
(provide 'init-git)
|