Skip to content

Instantly share code, notes, and snippets.

@minorugh
Created June 28, 2023 21:54
Show Gist options
  • Save minorugh/a9585b439ca6156afdd832541dfd0bfa to your computer and use it in GitHub Desktop.
Save minorugh/a9585b439ca6156afdd832541dfd0bfa to your computer and use it in GitHub Desktop.
tempbuf
(leaf tempbuf
:doc "Auto kill unused buffers in the background"
:el-get (tempbuf :url "http://www.emacswiki.org/emacs/download/tempbuf.el")
:hook ((find-file-hook . my:find-file-tempbuf-hook)
((dired-mode-hook magit-mode-hook) . turn-on-tempbuf-mode))
:custom
`((tempbuf-kill-message . nil)
(my:tempbuf-ignore-files . '("~/Dropbox/org/task.org")))
:init
(defun my:find-file-tempbuf-hook ()
(let ((ignore-file-names (mapcar 'expand-file-name my:tempbuf-ignore-files)))
(unless (member (buffer-file-name) ignore-file-names)
(turn-on-tempbuf-mode)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment