forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-ibuffer.el
58 lines (44 loc) · 1.62 KB
/
init-ibuffer.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
;;; init-ibuffer.el --- ibuffer settings -*- lexical-binding: t -*-
;;; Commentary:
;; TODO: enhance ibuffer-fontification-alist
;; See http://www.reddit.com/r/emacs/comments/21fjpn/fontifying_buffer_list_for_emacs_243/
;;; Code:
(require-package 'fullframe)
(with-eval-after-load 'ibuffer
(fullframe ibuffer ibuffer-quit))
(require-package 'ibuffer-vc)
(defun ibuffer-set-up-preferred-filters ()
(ibuffer-vc-set-filter-groups-by-vc-root)
(unless (eq ibuffer-sorting-mode 'filename/process)
(ibuffer-do-sort-by-filename/process)))
(add-hook 'ibuffer-hook 'ibuffer-set-up-preferred-filters)
(setq-default ibuffer-show-empty-filter-groups nil)
(with-eval-after-load 'ibuffer
;; Use human readable Size column instead of original one
(define-ibuffer-column size-h
(:name "Size" :inline t)
(file-size-human-readable (buffer-size))))
;; Modify the default ibuffer-formats (toggle with `)
(setq ibuffer-formats
'((mark modified read-only vc-status-mini " "
(name 22 22 :left :elide)
" "
(size-h 9 -1 :right)
" "
(mode 12 12 :left :elide)
" "
vc-relative-file)
(mark modified read-only vc-status-mini " "
(name 22 22 :left :elide)
" "
(size-h 9 -1 :right)
" "
(mode 14 14 :left :elide)
" "
(vc-status 12 12 :left)
" "
vc-relative-file)))
(setq ibuffer-filter-group-name-face 'font-lock-doc-face)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(provide 'init-ibuffer)
;;; init-ibuffer.el ends here