blob: 85516474471bb2e8d9c05e27d3713640c7ee3e94 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
;;; rul-vc.el --- Version control configuration -*- lexical-binding: t; -*-
(setq vc-follow-symlinks nil)
(use-package magit
:ensure t
:bind (("C-c g s" . magit-status)
("C-c g F" . magit-pull-from-upstream)
("C-c g b" . magit-blame))
:hook (git-commit-setup . rul/git-commit-setup)
:config
(defun rul/git-commit-setup ()
"Enable useful text modes for Git commit buffers."
(flyspell-mode 1)
(auto-fill-mode 1))
(defun rul/magit-status-save-window-config (&rest _)
"Save current window configuration before invoking `magit-status'."
(window-configuration-to-register :magit-fullscreen))
(defun rul/magit-status-single-window (&rest _)
"Display `magit-status' in a single window."
(delete-other-windows))
(advice-add 'magit-status :before #'rul/magit-status-save-window-config)
(advice-add 'magit-status :after #'rul/magit-status-single-window))
(with-eval-after-load 'project
(add-to-list 'project-switch-commands
'(magit-project-status "Magit" "m")))
(provide 'rul-vc)
;;; rul-vc.el ends here
|