1 ;;; bandali-ibuffer.el --- bandali's Ibuffer setup -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2018-2020 Amin Bandali
5 ;; Author: Amin Bandali <bandali@gnu.org>
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
29 (("C-x C-b" . ibuffer
)
31 ("P" . ibuffer-backward-filter-group
)
32 ("N" . ibuffer-forward-filter-group
)
33 ("M-p" . ibuffer-do-print
)
34 ("M-n" . ibuffer-do-shell-command-pipe-replace
))
36 ;; Use human readable Size column instead of original one
37 (define-ibuffer-column size-h
38 (:name
"Size" :inline t
)
40 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
41 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
42 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
43 (t (format "%8d" (buffer-size)))))
45 (ibuffer-saved-filter-groups
47 ("dired" (mode . dired-mode
))
48 ("org" (mode . org-mode
))
51 (mode . gnus-group-mode
)
52 (mode . gnus-summary-mode
)
53 (mode . gnus-article-mode
)
55 (mode . message-mode
)))
74 (mode . emacs-lisp-mode
)
86 (name .
"^\\*scratch\\*$")
87 (name .
"^\\*Messages\\*$")))
88 ("exwm" (mode . exwm-mode
))
89 ("erc" (mode . erc-mode
)))))
91 '((mark modified read-only locked
" "
92 (name 72 72 :left
:elide
)
96 (mode 16 16 :left
:elide
)
97 " " filename-and-process
)
101 :hook
(ibuffer .
(lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
103 (provide 'bandali-ibuffer
)
104 ;;; bandali-ibuffer.el ends here