diff options
| author | Ivan Popovych <ivan.popovich000@gmail.com> | 2022-03-06 21:14:32 +0200 |
|---|---|---|
| committer | Ivan Popovych <ivan.popovich000@gmail.com> | 2022-03-06 21:14:32 +0200 |
| commit | 1440189cd6a020e645dd29c1339b92c864028479 (patch) | |
| tree | fe9746c3f8b1d0ca828c901500d90f8db6c2a2b1 | |
| parent | 4ef2613ab46f8be4022211e557bb70f5d78752b2 (diff) | |
Add consult integration
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | perspective.el | 14 |
2 files changed, 25 insertions, 0 deletions
@@ -246,6 +246,17 @@ show buffers in all perspectives. In addition, Perspective adds actions to to the prefix-argument version) and to remove buffers from the current perspective. +**Consult**: Perspective provides `persp-consult-source` source that will list +buffers in current perspective. You can hide default buffer source +and add `persp-consult-source` to `consult-buffer-sources` for consult +to only list buffers in current perspective, note that you can access +list of all buffers by filtering with `b` key. Example configuration: + +```emacs-lisp +(consult-customize consult--source-buffer :hidden t :default nil) +(add-to-list consult-buffer-sources persp-consult-source) +``` + **Ivy / Counsel**: Perspective provides two commands for listing buffers using Ivy and Counsel: `persp-ivy-switch-buffer` and `persp-counsel-switch-buffer`. When these functions are called normally, they show a list of buffers filtered diff --git a/perspective.el b/perspective.el index d51f09c..806197c 100644 --- a/perspective.el +++ b/perspective.el @@ -1546,6 +1546,20 @@ PERSP-SET-IDO-BUFFERS)." (ibuffer)) (ibuffer))) +;; Buffer switching integration: Consult + +(defvar persp-consult-source + (list :name "Perspective" + :narrow ?s + :category 'buffer + :state #'consult--buffer-state + :history 'buffer-name-history + :default t + :items + (lambda () (consult--buffer-query :sort 'visibility + :predicate 'persp-is-current-buffer + :as #'buffer-name)))) + ;; Buffer switching integration: Ivy. ;; ;; An alternative implementation, which has the drawback of not allowing a |
