dotfiles/emacs/.emacs.d/init/oni-magit-init.org

927 B

Magit

  (require 'magit)

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.

  (require 'magithub)

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

  (setq magit-diff-refine-hunk 'all)

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

  (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))