;;; ravi-init-vc.el --- vc control ;; Copyright (C) 2013 ;; Author: ;; Keywords: vc ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; Version control initialization ;;; Code: ;; Git (use-package magit :bind (("" . magit-status) ("C-x v B" . magit-blame) ("C-x v F" . magit-file-log)) :config (progn (setq-default magit-process-popup-time 10 magit-diff-refine-hunk t magit-completing-read-function (if ravi/use-helm-instead-of-ido 'helm--completing-read-default 'magit-ido-completing-read)) (setq magit-restore-window-configuration t) (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) (use-package magit-svn :config (add-hook 'magit-mode-hook 'magit-svn-mode) :ensure t) ) :ensure t) (use-package gitignore-mode :ensure t) (use-package gitconfig-mode :ensure t) (use-package git-messenger :bind ("C-x v p" . git-messenger:popup-message) :ensure t) (use-package git-timemachine :bind ("C-x v t" . git-timemachine) :ensure t) (use-package vc-git :bind ("C-x v f" . vc-git-grep)) (use-package diff-hl :config (global-diff-hl-mode) :ensure t) ;; Stolen almost entirely from Fuco (Matus Goljer) (use-package ediff :config (progn (defvar my-ediff-before-config nil "Window configuration before ediff.") (defvar my-ediff-after-config nil "Window configuration after ediff.") (defun my-ediff-before-setup () "Function to be called before any buffers or window setup for ediff." (setq my-ediff-before-config (current-window-configuration)) (set-register ?b (list my-ediff-before-config (point-marker)))) (defun my-ediff-after-setup () "Function to be called after buffers and window setup for ediff." (setq my-ediff-after-config (current-window-configuration)) (set-register ?e (list my-ediff-after-config (point-marker)))) (defun my-ediff-quit () "Function to be called when ediff quits." (when my-ediff-before-config (set-window-configuration my-ediff-before-config)) ;; clean up ediff bullshit (->> (buffer-list) (-map 'buffer-name) (--select (string-match-p "\\*[Ee]diff" it)) (-map 'kill-buffer))) (add-hook 'ediff-before-setup-hook 'my-ediff-before-setup) (add-hook 'ediff-after-setup-windows-hook 'my-ediff-after-setup 'append) (add-hook 'ediff-quit-hook 'my-ediff-quit))) (provide 'ravi-init-vc) ;;; ravi-init-vc.el ends here