Emacs: group buffers in ibuffer by project, showing relative path
Alan Pearce alan@alanpearce.eu
Sun, 06 Aug 2023 20:05:34 +0200
2 files changed, 16 insertions(+), 0 deletions(-)
M user/emacs/init.el → user/emacs/init.el
@@ -925,6 +925,21 @@ (evil-ex-define-cmd "pesh[ell]" #'project-eshell) (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
M user/settings/emacs.nix → user/settings/emacs.nix
@@ -149,6 +149,7 @@ git-modes git-timemachine goto-chg helpful + ibuffer-project jinx just-mode justl