[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 5115df3 184/399: counsel.el: counsel-switch-buffer-other-w

From: Oleh Krehel
Subject: [elpa] master 5115df3 184/399: counsel.el: counsel-switch-buffer-other-window: new command.
Date: Sat, 20 Jul 2019 14:57:20 -0400 (EDT)

branch: master
commit 5115df3ee1c751f5cc7e64d86324db490174d990
Author: Nathan Moreau <address@hidden>
Commit: Nathan Moreau <address@hidden>

    counsel.el: counsel-switch-buffer-other-window: new command.
 counsel.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/counsel.el b/counsel.el
index a883c7e..76fcb4d 100644
--- a/counsel.el
+++ b/counsel.el
@@ -5145,6 +5145,20 @@ in the current window."
             :unwind #'counsel--switch-buffer-unwind
             :update-fn 'counsel--switch-buffer-update-fn))
+(defun counsel-switch-buffer-other-window ()
+  "Switch to another buffer in another window.
+Display a preview of the selected ivy completion candidate buffer
+in the current window."
+  (interactive)
+  (ivy-read "Switch to buffer in another window: " 'internal-complete-buffer
+            :preselect (buffer-name (other-buffer (current-buffer)))
+            :action #'ivy--switch-buffer-other-window-action
+            :matcher #'ivy--switch-buffer-matcher
+            :caller 'counsel-switch-buffer-other-window
+            :unwind #'counsel--switch-buffer-unwind
+            :update-fn 'counsel--switch-buffer-update-fn))
 ;;** `counsel-compile'
 (defvar counsel-compile-history nil
   "History for `counsel-compile'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]