Created
June 26, 2015 21:20
-
-
Save cjauvin/39357f1b8918c8287b90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (setq my-helm-source-file-buffers-list | |
| (helm-make-source "Files" 'my-helm-source-file-buffers-class) | |
| my-helm-source-nonfile-buffers-list | |
| (helm-make-source "Buffers" 'my-helm-source-nonfile-buffers-class)) | |
| (setq helm-mini-default-sources '(my-helm-source-file-buffers-list | |
| my-helm-source-nonfile-buffers-list | |
| helm-source-recentf | |
| helm-source-buffer-not-found)) | |
| helm-buffers-list-cache | |
| (defclass my-helm-source-file-buffers-class (helm-source-sync helm-type-buffer) | |
| ((buffer-list | |
| :initarg :buffer-list | |
| :initform #'helm-buffer-list | |
| :custom function | |
| :documentation | |
| " A function with no arguments to create buffer list.") | |
| (init :initform 'helm-buffers-list--init) | |
| (candidates :initform | |
| (lambda () | |
| (mapcar 'buffer-name (remove-if-not #'buffer-file-name (buffer-list))))) | |
| (matchplugin :initform nil) | |
| (match :initform 'helm-buffers-match-function) | |
| (persistent-action :initform 'helm-buffers-list-persistent-action) | |
| (resume :initform (lambda () | |
| (run-with-idle-timer | |
| 0.1 nil (lambda () | |
| (with-helm-buffer | |
| (helm-force-update)))))) | |
| (keymap :initform helm-buffer-map) | |
| (volatile :initform t) | |
| (mode-line :initform helm-buffer-mode-line-string) | |
| (persistent-help | |
| :initform | |
| "Show this buffer / C-u \\[helm-execute-persistent-action]: Kill this buffer"))) | |
| (defclass my-helm-source-nonfile-buffers-class (helm-source-sync helm-type-buffer) | |
| ((buffer-list | |
| :initarg :buffer-list | |
| :initform #'helm-buffer-list | |
| :custom function | |
| :documentation | |
| " A function with no arguments to create buffer list.") | |
| (init :initform 'helm-buffers-list--init) | |
| (candidates :initform | |
| (lambda () | |
| (mapcar 'buffer-name (remove-if #'buffer-file-name (buffer-list))))) | |
| (matchplugin :initform nil) | |
| (match :initform 'helm-buffers-match-function) | |
| (persistent-action :initform 'helm-buffers-list-persistent-action) | |
| (resume :initform (lambda () | |
| (run-with-idle-timer | |
| 0.1 nil (lambda () | |
| (with-helm-buffer | |
| (helm-force-update)))))) | |
| (keymap :initform helm-buffer-map) | |
| (volatile :initform t) | |
| (mode-line :initform helm-buffer-mode-line-string) | |
| (persistent-help | |
| :initform | |
| "Show this buffer / C-u \\[helm-execute-persistent-action]: Kill this buffer"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment