.emacs.d/lisp/init-git.el
2025-03-19 21:10:56 +01:00

37 lines
977 B
EmacsLisp
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; init-git.el --- Git SCM support -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(require-package 'git-modes)
(when (maybe-require-package 'git-timemachine)
(global-set-key (kbd "C-x v t") 'git-timemachine-toggle))
(when (maybe-require-package 'magit)
(setq-default magit-diff-refine-hunk 'all)
;;(sanityinc/fullframe-mode 'magit-status-mode) ; TODO get this done
;; Hint: customize `magit-repository-directories' so that you can use C-u M-F12 to
;; quickly open magit on any one of your projects.
(global-set-key [(meta f12)] 'magit-status)
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x M-g") 'magit-dispatch)
)
(maybe-require-package 'magit-todos)
(when (maybe-require-package 'git-commit)
(add-hook 'git-commit-mode-hook 'goto-address-mode))
;; Convenient binding for vc-git-grep
(with-eval-after-load 'vc
(define-key vc-prefix-map (kbd "f") 'vc-git-grep))
(provide 'init-git)
;;; init-git.el ends here