setup ibuffer
parent
04f350f889
commit
895bccda9e
@ -0,0 +1,8 @@
|
||||
(setq ibuffer-saved-filter-groups
|
||||
'(("default"
|
||||
("misc" (name . "^\\*.*$"))
|
||||
("dired" (mode . dired-mode)))))
|
||||
|
||||
(add-hook 'ibuffer-mode-hook (lambda () (ibuffer-switch-to-saved-filter-groups "default")))
|
||||
|
||||
(provide 'config-ibuffer-filter-groups)
|
@ -0,0 +1,16 @@
|
||||
(define-ibuffer-column size-human-readable
|
||||
(:name "Size" :inline t)
|
||||
(let ((size (buffer-size)))
|
||||
(cond
|
||||
((> size (expt 1000 4))
|
||||
(error "buffer is over 1TB large!"))
|
||||
((> size (expt 1000 3))
|
||||
(format "%sG" (/ size (expt 1000 3))))
|
||||
((> size (expt 1000 2))
|
||||
(format "%sM" (/ size (expt 1000 2))))
|
||||
((> size 1000)
|
||||
(format "%sK" (/ size 1000)))
|
||||
(t
|
||||
(format "%sB" size)))))
|
||||
|
||||
(provide 'config-ibuffer-human-readable-size)
|
@ -0,0 +1,11 @@
|
||||
(defvar config-ibuffer-never-show '("^\\*Messages\\*$"
|
||||
"^\\*Help\\*$"
|
||||
"^\\*Completions\\*$"
|
||||
"^\\*Backtrace\\*$"
|
||||
"^\\*Async-native-compile-log\\*$"))
|
||||
|
||||
(mapc (lambda (p)
|
||||
(add-to-list 'ibuffer-never-show-predicates p))
|
||||
config-ibuffer-never-show)
|
||||
|
||||
(provide 'config-ibuffer-never-show)
|
@ -0,0 +1,22 @@
|
||||
(require 'ibuffer)
|
||||
(require 'ibuf-ext)
|
||||
(require 'config-ibuffer-human-readable-size)
|
||||
(require 'config-ibuffer-never-show)
|
||||
(require 'config-ibuffer-filter-groups)
|
||||
|
||||
(setq ibuffer-display-summary nil
|
||||
ibuffer-expert t)
|
||||
|
||||
(setq ibuffer-formats
|
||||
'((mark modified read-only locked " "
|
||||
(name 18 18 :left :elide)
|
||||
" "
|
||||
(size-human-readable 5 5 :right)
|
||||
" "
|
||||
(mode 16 16 :left :elide)
|
||||
" " filename-and-process)
|
||||
(mark " "
|
||||
(name 16 -1)
|
||||
" " filename)))
|
||||
|
||||
(provide 'config-ibuffer)
|
Loading…
Reference in New Issue