From eb896949d088a8429c5521279edf0479bf44453a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 6 Aug 2023 20:05:34 +0200 Subject: Emacs: group buffers in ibuffer by project, showing relative path --- user/emacs/init.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'user/emacs') diff --git a/user/emacs/init.el b/user/emacs/init.el index 4da7f9ab..713932ce 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -925,6 +925,21 @@ _p_rev _u_pper _=_: upper/lower _r_esolve (evil-ex-define-cmd "pb" #'project-switch-to-buffer) (evil-ex-define-cmd "psw[itch]" #'project-switch-project)))) +(use-package ibuffer-project + :config (progn + (defun ibuffer-project-set-filter-groups () + (setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups)) + (unless (eq ibuffer-sorting-mode 'project-file-relative) + (ibuffer-do-sort-by-project-file-relative))) + (add-hook 'ibuffer-hook #'ibuffer-project-set-filter-groups) + (add-to-list 'ibuffer-project-root-functions '(file-remote-p . "Remote")) + (setq ibuffer-formats '((mark modified read-only locked " " + (name 18 18 :left :elide) + " " + (size 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " project-file-relative))))) (use-package consult-ghq :defer 5 :general (:keymaps 'project-prefix-map -- cgit 1.4.1