forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-git.el
88 lines (59 loc) · 2.42 KB
/
init-git.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(require-package 'magit)
(require-package 'git-gutter-fringe)
(require-package 'git-blame)
(require-package 'git-commit-mode)
(require-package 'git-rebase-mode)
(require-package 'gitignore-mode)
(require-package 'gitconfig-mode)
(setq-default
magit-save-some-buffers nil
magit-process-popup-time 10
magit-diff-refine-hunk t
magit-completing-read-function 'magit-ido-completing-read)
;; Hint: customize `magit-repo-dirs' 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)
(require-package 'fullframe)
(fullframe magit-status magit-mode-quit-window :magit-fullscreen nil)
;;; When we start working on git-backed files, use git-wip if available
(after-load 'vc-git
(global-magit-wip-save-mode)
(diminish 'magit-wip-save-mode))
;;; Use the fringe version of git-gutter
(after-load 'git-gutter
(require 'git-gutter-fringe))
(when *is-a-mac*
(after-load 'magit
(add-hook 'magit-mode-hook (lambda () (local-unset-key [(meta h)])))))
;; Convenient binding for vc-git-grep
(global-set-key (kbd "C-x v f") 'vc-git-grep)
;;; git-svn support
(require-package 'magit-svn)
(after-load 'magit-key-mode
(require 'magit-svn))
(after-load 'compile
(dolist (defn (list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1)
'(git-svn-needs-update "^\\(.*\\): needs update$" 1 nil nil 2 1)))
(add-to-list 'compilation-error-regexp-alist-alist defn)
(add-to-list 'compilation-error-regexp-alist (car defn))))
(defvar git-svn--available-commands nil "Cached list of git svn subcommands")
(defun git-svn (dir)
"Run a git svn subcommand in DIR."
(interactive "DSelect directory: ")
(unless git-svn--available-commands
(setq git-svn--available-commands
(sanityinc/string-all-matches
"^ \\([a-z\\-]+\\) +"
(shell-command-to-string "git svn help") 1)))
(let* ((default-directory (vc-git-root dir))
(compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*")))
(compile (concat "git svn "
(ido-completing-read "git-svn command: " git-svn--available-commands nil t)))))
(require-package 'git-messenger)
(global-set-key (kbd "C-x v p") #'git-messenger:popup-message)
;;; github
(require-package 'yagist)
(require-package 'github-browse-file)
(require-package 'bug-reference-github)
(add-hook 'prog-mode-hook 'bug-reference-prog-mode)
(provide 'init-git)