jojojames / ibuffer-sidebar

A sidebar for IBuffer
GNU General Public License v3.0
69 stars 8 forks source link

Integration w/ `ibuffer-vc` or `ibuffer-projectile` #4

Closed arthurcgusmao closed 4 years ago

arthurcgusmao commented 4 years ago

Hi,

From the screenshots I see it's possible to integrate with ibuffer-vc. What specific configurations are necessary to have it working like so? Also, is there the possibility of integrating with ibuffer-projectile? Currently I have the latter configured and working fine in an ibuffer buffer, but nothing changes on the sidebar.

Thank you very much for your support.

jojojames commented 4 years ago

I use it with ibuffer-projectile.

(use-package ibuffer-projectile
  :ensure t
  :commands (ibuffer-projectile-set-filter-groups
             ibuffer-projectile-generate-filter-groups)
  :init
  (defun j-ibuffer-projectile-run ()
    "Set up `ibuffer-projectile'."
    (ibuffer-projectile-set-filter-groups)
    (unless (eq ibuffer-sorting-mode 'alphabetic)
      (ibuffer-do-sort-by-alphabetic)))

  (add-hook 'ibuffer-sidebar-mode-hook #'j-ibuffer-projectile-run)
  (add-hook 'ibuffer-hook #'j-ibuffer-projectile-run)
  :config
  (setq ibuffer-projectile-prefix "Project: "))

(use-package ibuffer-sidebar
  :load-path "~/.emacs.d/fork/ibuffer-sidebar"
  :ensure nil
  :commands (ibuffer-sidebar-toggle-sidebar)
  :config
  (setq ibuffer-sidebar-use-custom-font t))

I think it's just the hook you need to add to.

arthurcgusmao commented 4 years ago

Thank you @jojojames, your configurations worked quite well. I was missing the hook that should be added to ibuffer-sidebar-mode-hook, specifically:

(add-hook 'ibuffer-sidebar-mode-hook #'j-ibuffer-projectile-run)

Thank you for developing this neat package :)