-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup-magit.el
49 lines (41 loc) · 1.46 KB
/
setup-magit.el
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
;; Magit - Git interface
;; https://github.com/magit/magit
(autoload 'magit-grep "magit" "Grep for files" t)
;; key
(global-set-key (kbd "C-c g") 'magit-status)
(global-set-key (kbd "C-c f") 'magit-grep)
(when (eq system-type 'darwin)
(global-set-key (kbd "s-G") 'magit-status))
;; we no longer need vc-git
(delete 'Git vc-handled-backends)
(defun magit-maybe-commit (&optional show-options)
"Runs magit-commit unless prefix is passed"
(interactive "P")
(if show-options
(magit-key-mode-popup-committing)
(magit-commit)))
;; magit settings
(setq
;; use ido to look for branches
magit-completing-read-function 'magit-ido-completing-read
;; don't put "origin-" in front of new branch names by default
magit-default-tracking-name-function 'magit-default-tracking-name-branch-only
;; open magit status in same window as current buffer
magit-status-buffer-switch-function 'switch-to-buffer
;; highlight word/letter changes in hunk diffs
magit-diff-refine-hunk t
;; ask me if I want to include a revision when rewriting
magit-rewrite-inclusive 'ask
;; ask me to save buffers
magit-save-some-buffers t
;; pop the process buffer if we're taking a while to complete
magit-process-popup-time 10
;; ask me if I want a tracking upstream
magit-set-upstream-on-push t
;; don't show " MRev" in modeline
magit-auto-revert-mode-lighter ""
)
(require-package 'magit)
(after-load 'fullframe
(fullframe magit-status magit-mode-quit-window nil))
(provide 'setup-magit)