Add buffer overview to main helm shortcut menu

Often, I want to open some file and try to first open the corresponding buffer
in the hope there's some open buffer for it already.  When no such buffer
exists, I have to close the list of buffers, reopen the helm shortcut menu, and
navigate to the corresponding bookmark.  This is cumbersome and somehow
duplicate work, since the bookmark and the file most often are named similarly.

With a buffer overview in the helm shortcut menu I can now search for the file
directly and if it's already open, directly select the corresponding buffer.
If it has not been opened, though, I can navigate to the corresponding bookmark
with at most one additional keystroke (C-o) and open it there.  Nice!
This commit is contained in:
Daniel - 2020-05-15 10:44:08 +02:00
parent 2051347e72
commit 1be7f0e171
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 6 additions and 1 deletions

View File

@ -666,7 +666,10 @@ With given ARG, display files in `db/important-document-path."
:action '(("Open" . call-interactively))
:filtered-candidate-transformer #'helm-adaptive-sort)
;; if prefix arg is given, extrac files from
;; taken from `helm-buffers-list'
(helm-make-source "Buffers" 'helm-source-buffers)
;; if prefix arg is given, extract files from
;; `db/important-documents-path and list them as well
(when (and (= arg 4)
(file-directory-p db/important-documents-path))
@ -683,6 +686,8 @@ With given ARG, display files in `db/important-document-path."
("Find file" . find-file)))))
helm-source-bookmarks
helm-source-buffer-not-found
helm-source-bookmark-set)))