Skip to content

Commit

Permalink
Use default projectile grouping in centaur-tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
themkat committed Nov 10, 2024
1 parent a31631f commit 94716db
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions init.org
Original file line number Diff line number Diff line change
Expand Up @@ -502,32 +502,7 @@ Recently I also started using tabs with the centaur-tabs package:

:config
(centaur-tabs-mode 1)

;; Custom group function to get it the way _I_ want
(defun centaur-tabs-buffer-groups ()
"Groups tabs based on which project root they are in if possible"
(let ((get-closest-projectile-project
(lambda (path)
(let ((expanded-path (f-long path)))
(-first (lambda (proj)
(s-starts-with? proj
expanded-path))
(-map (lambda (proj)
(f-long proj))
projectile-known-projects))))))
(list (cond
;; Group as part of projectile project if directly part of it
((condition-case _err
(projectile-project-root)
(error nil))
(f-expand (projectile-project-root)))
;; Try to group as part of projectile project if indirectly part of it (started from the same directory, not yet tracked, or maybe temporary buffer)
(get-closest-projectile-project default-directory)
((string-equal "*" (substring (buffer-name) 0 1))
"proc-buffers")
;; ... other groupings ...
(t
"Other")))))
(centaur-tabs-projectile-buffer-groups)

:custom
(centaur-tabs-set-icons t)
Expand Down

0 comments on commit 94716db

Please sign in to comment.