dotfiles/emacs/.emacs.modular/config/init-git.el

33 lines
1.0 KiB
EmacsLisp
Raw Normal View History

;; Magit!
(use-package magit
:config
(evil-collection-magit-setup)
:general
(leader-map "g" '(nil :which-key "git")
"gs" #'magit-status
"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))
(provide 'init-git)