From 1be7f0e17117e3c53549a1e57b1aa62ec1cd6727 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 15 May 2020 10:44:08 +0200 Subject: [PATCH] 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! --- init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index d28b2ef..86abec2 100644 --- a/init.el +++ b/init.el @@ -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)))