Add ibuffer filter group for the workspace
This introduces the +ibuffer-current-workspace function which open an ibuffer with only buffers from the current workspace. Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
This commit is contained in:
parent
a7d5da494e
commit
0ea1974732
1 changed files with 17 additions and 0 deletions
|
@ -39,6 +39,23 @@
|
||||||
:header-mouse-map ibuffer-size-header-map)
|
:header-mouse-map ibuffer-size-header-map)
|
||||||
(file-size-human-readable (buffer-size)))
|
(file-size-human-readable (buffer-size)))
|
||||||
|
|
||||||
|
(when (featurep! :ui workspaces)
|
||||||
|
(define-ibuffer-filter workspace-buffers
|
||||||
|
"Filter for workspace buffers"
|
||||||
|
(:reader
|
||||||
|
(+workspace-get (read-string "workspace name: ")) :description "workspace")
|
||||||
|
(memq buf (+workspace-buffer-list qualifier)))
|
||||||
|
|
||||||
|
(defun +ibuffer/workspace (workspace-name)
|
||||||
|
"Open an ibuffer window for a workspace"
|
||||||
|
(ibuffer nil (format "%s buffers" workspace-name)
|
||||||
|
(list (cons 'workspace-buffers (+workspace-get workspace-name)))))
|
||||||
|
|
||||||
|
(defun +ibuffer-current-workspace ()
|
||||||
|
"Open an ibuffer window for the current workspace"
|
||||||
|
(interactive)
|
||||||
|
(+ibuffer/workspace (+workspace-current-name))))
|
||||||
|
|
||||||
(when (featurep! :completion ivy)
|
(when (featurep! :completion ivy)
|
||||||
(defadvice! +ibuffer-use-counsel-maybe-a (_file &optional _wildcards)
|
(defadvice! +ibuffer-use-counsel-maybe-a (_file &optional _wildcards)
|
||||||
"Use `counsel-find-file' instead of `find-file'."
|
"Use `counsel-find-file' instead of `find-file'."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue