t

メモ

First Step of Customizing Magit

主に magit-status, magit-show-level-4, magit-commit を快適に使うべく、いくつかのサイトを参考に設定してみた。

;; http://d.hatena.ne.jp/syohex/20130904/1378310201
(defadvice magit-status (around magit-fullscreen activate)
  (window-configuration-to-register :magit-fullscreen)
  ad-do-it
  (delete-other-windows))
(defun my/magit-quit-session ()
  (interactive)
  (kill-buffer)
  (jump-to-register :magit-fullscreen))
(define-key magit-status-mode-map (kbd "q") 'my/magit-quit-session)
(defadvice git-commit-commit (after move-to-magit-buffer activate)
  (delete-window))

;; http://qiita.com/dtan4/items/658a8a7ca06aa8c2da4c
(set-variable 'magit-emacsclient-executable "/usr/local/Cellar/emacs/24.3/bin/emacsclient")

;; http://www.clear-code.com/blog/2012/4/3.html
(set-face-background 'magit-diff-file-header "gray15")
(set-face-background 'magit-diff-hunk-header "gray18")
(set-face-background 'magit-diff-none (face-background 'default))
(set-face-foreground 'magit-diff-none (face-foreground 'diff-context))
(set-face-background 'magit-diff-add (face-background 'diff-added))
(set-face-foreground 'magit-diff-add (face-foreground 'diff-added))
(set-face-background 'magit-diff-del (face-background 'diff-removed))
(set-face-foreground 'magit-diff-del (face-foreground 'diff-removed))
(set-face-background 'magit-item-highlight (face-background 'helm-selection))
(setq magit-diff-refine-hunk 'all)