From 46fcf6ca390af119f649a942cba4fe3721928f96 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 14 Aug 2015 21:43:53 +0200 Subject: Emacs: Better project buffer switching with ivy --- tag-emacs/emacs.d/init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 392f76e0..991af461 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -1198,7 +1198,16 @@ replace helm and ido. ("" . counsel-M-x) ("" . counsel-M-x) ("C-c M-x" . execute-extended-command) - ("C-x C-f" . counsel-find-file))) + ("C-x C-f" . counsel-find-file) + ("C-x b" . counsel-switch-to-projectile-buffer)) + :config (progn + (defun counsel-switch-to-projectile-buffer (arg) + "Forward to `projectile-switch-to-buffer'." + (ivy-read (format "Switch to buffer [%s]: " (projectile-project-name)) + (projectile-project-buffer-names) + :preselect (buffer-name (other-buffer (current-buffer))) + :action #'ivy--switch-buffer-action + :keymap ivy-switch-buffer-map)))) #+END_SRC -- cgit 1.4.1