From 65464658d5db34f4af9faead1de657c0fd905ae1 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Sun, 1 Dec 2013 22:01:07 -0800 Subject: Easy switching in ibuffer to previous buffer diff --git a/ravi-init-ido.el b/ravi-init-ido.el index 8173353..307a35a 100644 --- a/ravi-init-ido.el +++ b/ravi-init-ido.el @@ -27,7 +27,17 @@ ;; Almost all of the code below is stolen from jwiegley's .emacs.d. (use-package ibuffer - :bind ("C-x C-b" . ibuffer)) + :bind ("C-x C-b" . ibuffer) + :config + (progn + ;; 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))) + ) + ) ;;;_ , ido -- cgit v0.10.1