ema2159 / centaur-tabs

Emacs plugin aiming to become an aesthetic, modern looking tabs plugin
GNU General Public License v3.0
727 stars 50 forks source link

centaur-tabs-buffer-groups behaviour #202

Open LionyxML opened 1 year ago

LionyxML commented 1 year ago

Hello there!

Thanks again for this awesome package!

I was reading through the docs and came up with this config of my own (something from README a little bit tricked to include ERC, GNUS and EWW groups).

So in my .emacs I included:

(defun centaur-tabs-buffer-groups ()
  "`centaur-tabs-buffer-groups' control buffers' group rules.

Group centaur-tabs with mode if buffer is derived from `eshell-mode' `emacs-lisp-mode' `dired-mode' `org-mode' `magit-mode'.
All buffer name start with * will group to \"Emacs\".
Other buffer group by `centaur-tabs-get-group-name' with project name."
  (list
   (cond
    ((or (string-equal "*" (substring (buffer-name) 0 1))
         (memq major-mode '(magit-process-mode
                            magit-status-mode
                            magit-diff-mode
                            magit-log-mode
                            magit-file-mode
                            magit-blob-mode
                            magit-blame-mode
                            )))
     "Emacs")
    ((derived-mode-p 'prog-mode)
     "Editing")
    ((derived-mode-p 'dired-mode)
     "Dired")
    ((memq major-mode '(erc-mode))
     "ERC")
    ((memq major-mode '(gnus-group-mode))
     "GNUS")
    ((memq major-mode '(eww-mode))
     "EWW")   
    ((memq major-mode '(helpful-mode
                        help-mode))
     "Help")
    ((memq major-mode '(org-mode
                        org-agenda-clockreport-mode
                        org-src-mode
                        org-agenda-mode
                        org-beamer-mode
                        org-indent-mode
                        org-bullets-mode
                        org-cdlatex-mode
                        org-agenda-log-mode
                        diary-mode))
     "OrgMode")
    (t
     (centaur-tabs-get-group-name (current-buffer))))))

(centaur-tabs-buffer-groups)
(centaur-tabs-mode t)

With projectile everything seems to be ok. Groups are created for my projects. (case with auto-dark and magit-stats) image

But with emacs buffers in general there's no respect to what goes where when:

Sometimes ERC is in terminal, anothers in Others, it even splits the server buffer and channels buffers trough different groups. Example: image

Now I open vterm and there's a Term group, but also, prettier I was using in another project comes there: image

What am I doing wrong? Should this defun be like I made? Is there any trick or workflow I am missing?

Thanks!