aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init/oni-magit-init.org
blob: 7981a77267a539b93cfb9d70670105c35e441add (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
34
35
36
37
#+TITLE: Magit

#+BEGIN_SRC emacs-lisp
  (require 'magit)
#+END_SRC

Magit is a very nice interface to Git for Emacs. It allows you to do
just about anything with Git without leaving the comfort of your Emacs
session.

Integrate github issues and pull requests in Magit. Requires the =hub=
executable.

#+BEGIN_SRC emacs-lisp
  (require 'magithub)
#+END_SRC

Show refined diffs in magit. This makes it much easier to see /what/
has changed on a line.

#+BEGIN_SRC emacs-lisp
  (setq magit-diff-refine-hunk 'all)
#+END_SRC

Make the magit status buffer always open as the only window in Emacs.

#+BEGIN_SRC emacs-lisp
  (defvar oni:magit-status-rx
    (rx bos "*magit: "))

  (defun oni:display-buffer-in-only-window (buffer alist)
    (delete-other-windows)
    (display-buffer-same-window buffer alist))

  (add-to-list 'display-buffer-alist
               `(,oni:magit-status-rx oni:display-buffer-in-only-window))
#+END_SRC