Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centaur-tabs-buffer-groups behaviour #202

Open
LionyxML opened this issue Mar 7, 2023 · 0 comments
Open

centaur-tabs-buffer-groups behaviour #202

LionyxML opened this issue Mar 7, 2023 · 0 comments

Comments

@LionyxML
Copy link

LionyxML commented Mar 7, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant