summaryrefslogtreecommitdiff
path: root/lisp/init-git.el
blob: 53a039e49c1a5fc95b5c3ba3661dccc5b002625d (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
(require-package 'magit)
(require-package 'git-commit-mode)
(require-package 'git-annex)
(require 'git-annex)

(setq git-annex-commit nil)

(key-chord-define-global ",g" 'magit-status)

(defun km/magit-auto-commit ()
  "Commit all changes with \"auto\" commit message.
Useful for non-source code repos (e.g., Org mode note files)."
  (interactive)
  (magit-run-git "commit" "--all" "--message=auto"))


(eval-after-load 'magit
    '(magit-key-mode-insert-action 'committing
                                   "u" "Auto commit" 'km/magit-auto-commit))

;; http://whattheemacsd.com/setup-magit.el-01.html
(defadvice magit-status (around magit-fullscreen activate)
  ad-do-it
  (delete-other-windows))

(setq magit-restore-window-configuration t
      magit-default-tracking-name-function 'magit-default-tracking-name-branch-only
      magit-completing-read-function 'magit-ido-completing-read
      magit-log-show-margin nil)

(provide 'init-git)