From 36c8b991eeaa75ac2572faff2c4ce58b426a1620 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 16 Oct 2016 22:32:11 +0200 Subject: Make sure init files have unique names --- emacs/.emacs.d/init/oni-magit-init.org | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 emacs/.emacs.d/init/oni-magit-init.org (limited to 'emacs/.emacs.d/init/oni-magit-init.org') diff --git a/emacs/.emacs.d/init/oni-magit-init.org b/emacs/.emacs.d/init/oni-magit-init.org new file mode 100644 index 0000000..217d45c --- /dev/null +++ b/emacs/.emacs.d/init/oni-magit-init.org @@ -0,0 +1,30 @@ +#+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. + +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 -- cgit v1.2.3-54-g00ecf