diff options
| -rw-r--r-- | init.el | 26 | ||||
| -rw-r--r-- | ravi-init-appearance.el | 2 | ||||
| -rw-r--r-- | ravi-init-vc.el | 105 |
3 files changed, 131 insertions, 2 deletions
@@ -54,8 +54,32 @@ (require 'use-package) (require 'diminish) -;; Initialize appearance +;; Show full frame windows for certain commands +(use-package fullframe + :ensure t + ) + +;; --------------------------------------------------------------------- +;; Stolen from purcell/emacs.d/init-utils.el +(defmacro after-load (feature &rest body) + "After FEATURE is loaded, evaluate BODY." + (declare (indent defun)) + `(eval-after-load ,feature + '(progn ,@body))) + +(defun sanityinc/string-all-matches (regex str &optional group) + "Find all matches for `REGEX' within `STR', returning the full match string or group `GROUP'." + (let ((result nil) + (pos 0) + (group (or group 0))) + (while (string-match regex str pos) + (push (match-string group str) result) + (setq pos (match-end group))) + result)) +;; --------------------------------------------------------------------- + (require 'ravi-init-ido) (require 'ravi-init-marks) (require 'ravi-init-appearance) (require 'ravi-init-files) +(require 'ravi-init-vc) diff --git a/ravi-init-appearance.el b/ravi-init-appearance.el index 90c198a..69b77d9 100644 --- a/ravi-init-appearance.el +++ b/ravi-init-appearance.el @@ -69,7 +69,7 @@ (add-hook 'before-save-hook 'whitespace-cleanup) ) ; No need for 'ensure: t' since whitespace mode is built in - :diminish + :diminish global-whitespace-mode ) ;; Handling end of files. diff --git a/ravi-init-vc.el b/ravi-init-vc.el new file mode 100644 index 0000000..f3bd350 --- /dev/null +++ b/ravi-init-vc.el @@ -0,0 +1,105 @@ +;;; ravi-init-vc.el --- vc control + +;; Copyright (C) 2013 + +;; Author: <ravi@nero.lan> +;; 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 <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Version control initialization + +;;; Code: + +;; Git +(use-package magit + :bind ("<M-f3>" . magit-status) + :config + (progn + (setq-default + magit-process-popup-time 10 + magit-diff-refine-hunk t + magit-completing-read-function 'magit-ido-completing-read + ) + (require 'fullframe) + (fullframe magit-status magit-mode-quit-window :magit-fullscreen nil) + (use-package vc-git + :defer t + :bind ("C-x v f" . vc-git-grep) + :config + (progn + (global-magit-wip-save-mode) + (diminish 'magit-wip-save-mode) + ) + ) + (after-load 'magit-key-mode + (require 'magit-svn)) + + (after-load 'compile + (dolist (defn (list '(git-svn-updated "^\t[A-Z]\t\\(.*\\)$" 1 nil nil 0 1) + '(git-svn-needs-update "^\\(.*\\): needs update$" 1 nil nil 2 1))) + (add-to-list 'compilation-error-regexp-alist-alist defn) + (add-to-list 'compilation-error-regexp-alist (car defn)))) + + (defvar git-svn--available-commands nil "Cached list of git svn subcommands") + + (defun git-svn (dir) + "Run a git svn subcommand in DIR." + (interactive "DSelect directory: ") + (unless git-svn--available-commands + (setq git-svn--available-commands + (sanityinc/string-all-matches + "^ \\([a-z\\-]+\\) +" + (shell-command-to-string "git svn help") 1))) + (let* ((default-directory (vc-git-root dir)) + (compilation-buffer-name-function (lambda (major-mode-name) "*git-svn*"))) + (compile (concat "git svn " + (ido-completing-read "git-svn command: " + git-svn--available-commands nil t)))) + ) + ) + :ensure t + ) +(use-package git-gutter + :config + (progn + (use-package git-gutter-fringe + :ensure t + ) + (global-git-gutter-mode 1) + ) + :ensure t + :diminish git-gutter-mode + ) +(use-package git-commit-mode + :ensure t + ) +(use-package git-rebase-mode + :ensure t + ) +(use-package gitignore-mode + :ensure t + ) +(use-package gitconfig-mode + :ensure t + ) +(use-package git-messenger + :ensure t + :bind ("C-x v p" . git-messenger:popup-message) + ) + +(provide 'ravi-init-vc) +;;; ravi-init-vc.el ends here |
