From 491bd878eee20a6a3651867240dc6a1b46a5b8b5 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Sun, 2 Mar 2014 17:20:45 -0800 Subject: Sort by vc in ibuffer mode diff --git a/ravi-init-ido.el b/ravi-init-ido.el index 1312379..9d20034 100644 --- a/ravi-init-ido.el +++ b/ravi-init-ido.el @@ -30,12 +30,24 @@ :bind ("C-x C-b" . ibuffer) :config (progn + + (use-package ibuffer-vc + :ensure t + :commands ibuffer-vc-set-filter-groups-by-vc-root + ) + ;; Switching to ibuffer puts the cursor on the most recent past buffer (defadvice ibuffer (around ibuffer-point-to-most-recent-but-one activate) () "Open ibuffer with cursor pointed to most recent buffer name" (let ((recent-buffer-name (buffer-name (other-buffer (current-buffer) t)))) ad-do-it (ibuffer-jump-to-buffer recent-buffer-name))) + + (defun ravi/ibuffer-vc-sort-hook () + (ibuffer-vc-set-filter-groups-by-vc-root) + (unless (eq ibuffer-sorting-mode 'alphabetic) + (ibuffer-do-sort-by-alphabetic))) + (add-hook 'ibuffer-hook 'ravi/ibuffer-vc-sort-hook) ) ) -- cgit v0.10.1