Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom iBuffer filter for unsaved buffers
(define-ibuffer-filter unsaved-file-buffers
"Toggle current view to buffers whose file is unsaved."
(:description "file is unsaved")
(ignore qualifier)
(and (buffer-local-value 'buffer-file-name buf)
(buffer-modified-p buf)))
(define-key ibuffer-mode-map (kbd "/ u") #'ibuffer-filter-by-unsaved-file-buffers)
;; Then you can press </ u> in iBuffer
;; Note that in Spacemacs you'd have to use <\ u>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment