Remove tab customization

This commit is contained in:
Tristan D. 2025-03-17 23:19:48 +01:00
parent 9e35eac91a
commit 88d382c1ae
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
2 changed files with 76 additions and 76 deletions

View file

@ -252,89 +252,89 @@
(setq! uniquify-separator "/")
(setq! uniquify-buffer-name-style 'forward)
(use-package centaur-tabs
:init
(setq centaur-tabs-enable-key-bindings t)
:config
(setq centaur-tabs-style "wave"
centaur-tabs-height 32
centaur-tabs-set-icons t
centaur-tabs-show-new-tab-button t
centaur-tabs-show-navigation-buttons t
centaur-tabs-set-bar 'under
centaur-tabs-show-count t
centaur-tabs-gray-out-icons 'buffer
x-underline-at-descent-line t
centaur-tabs-set-modified-marker t
centaur-tabs-modified-marker ""
centaur-tabs-close-button "x"
centaur-tabs-cycle-scope 'tabs
centaur-tabs-adjust-buffer-order t
centaur-tabs-left-edge-margin nil)
;; (use-package centaur-tabs
;; :init
;; (setq centaur-tabs-enable-key-bindings t)
;; :config
;; (setq centaur-tabs-style "wave"
;; centaur-tabs-height 32
;; centaur-tabs-set-icons t
;; centaur-tabs-show-new-tab-button t
;; centaur-tabs-show-navigation-buttons t
;; centaur-tabs-set-bar 'under
;; centaur-tabs-show-count t
;; centaur-tabs-gray-out-icons 'buffer
;; x-underline-at-descent-line t
;; centaur-tabs-set-modified-marker t
;; centaur-tabs-modified-marker "•"
;; centaur-tabs-close-button "x"
;; centaur-tabs-cycle-scope 'tabs
;; centaur-tabs-adjust-buffer-order t
;; centaur-tabs-left-edge-margin nil)
(centaur-tabs-change-fonts (face-attribute 'default :font) 110)
(centaur-tabs-headline-match)
(centaur-tabs-group-by-projectile-project)
;; (centaur-tabs-enable-buffer-alphabetical-reordering)
(centaur-tabs-mode t)
;; (centaur-tabs-change-fonts (face-attribute 'default :font) 110)
;; (centaur-tabs-headline-match)
;; (centaur-tabs-group-by-projectile-project)
;; ;; (centaur-tabs-enable-buffer-alphabetical-reordering)
;; (centaur-tabs-mode t)
(defvar categories-alist
'(
(:name "org" :modes (org-mode org-agenda-mode) :buffer-name () :type global)
(:name "gptel" :modes nil :buffer-name ("*llama-cpp*" "*llama-cpp-code*" "*llama-cpp-bigchat*" "*llama-cpp-biggerchat*" "*gptel*" "*groq*" "*gptel-context*" "*gptel-query*") :type global)
(:name "terminal" :modes (vterm-mode term-mode) :buffer-name () :type per-project)
(:name "misc" :modes (+doom-dashboard-mode native-comp-limple-mode messages-buffer-mode) :buffer-name () :type global)
(:name "misc" :modes (special-mode fundamental-mode) :buffer-name () :type per-project)
)
"Mapping of categories to modes with their respective type logic.")
;; (defvar categories-alist
;; '(
;; (:name "org" :modes (org-mode org-agenda-mode) :buffer-name () :type global)
;; (:name "gptel" :modes nil :buffer-name ("*llama-cpp*" "*llama-cpp-code*" "*llama-cpp-bigchat*" "*llama-cpp-biggerchat*" "*gptel*" "*groq*" "*gptel-context*" "*gptel-query*") :type global)
;; (:name "terminal" :modes (vterm-mode term-mode) :buffer-name () :type per-project)
;; (:name "misc" :modes (+doom-dashboard-mode native-comp-limple-mode messages-buffer-mode) :buffer-name () :type global)
;; (:name "misc" :modes (special-mode fundamental-mode) :buffer-name () :type per-project)
;; )
;; "Mapping of categories to modes with their respective type logic.")
(defun get-project-name-or-default (default-name)
"Return the project name if available, or DEFAULT-NAME."
(if-let ((project-root (condition-case _err
(projectile-project-root)
(error nil))))
(concat (projectile-project-name) "::" default-name)
default-name))
;; (defun get-project-name-or-default (default-name)
;; "Return the project name if available, or DEFAULT-NAME."
;; (if-let ((project-root (condition-case _err
;; (projectile-project-root)
;; (error nil))))
;; (concat (projectile-project-name) "::" default-name)
;; default-name))
(defun get-category-name (buffer)
"Get category name for the given BUFFER."
(let (category-name)
(dolist (category categories-alist category-name)
(let ((buffer-names (plist-get category :buffer-name))
(modes (plist-get category :modes)))
(cond
((and buffer-names (member (buffer-name buffer) buffer-names))
(setq category-name
(if (eq (plist-get category :type) 'per-project)
(get-project-name-or-default (plist-get category :name))
(plist-get category :name))))
((and modes (with-current-buffer buffer (memq major-mode modes)))
(setq category-name
(if (eq (plist-get category :type) 'per-project)
(get-project-name-or-default (plist-get category :name))
(plist-get category :name)))))))))
;; (defun get-category-name (buffer)
;; "Get category name for the given BUFFER."
;; (let (category-name)
;; (dolist (category categories-alist category-name)
;; (let ((buffer-names (plist-get category :buffer-name))
;; (modes (plist-get category :modes)))
;; (cond
;; ((and buffer-names (member (buffer-name buffer) buffer-names))
;; (setq category-name
;; (if (eq (plist-get category :type) 'per-project)
;; (get-project-name-or-default (plist-get category :name))
;; (plist-get category :name))))
;; ((and modes (with-current-buffer buffer (memq major-mode modes)))
;; (setq category-name
;; (if (eq (plist-get category :type) 'per-project)
;; (get-project-name-or-default (plist-get category :name))
;; (plist-get category :name)))))))))
(defun centaur-tabs-group-name-by-category ()
"Get tab group name based on category."
(let ((mode-category (get-category-name (current-buffer))))
(if mode-category
(list mode-category)
(list (get-project-name-or-default "main")))))
;; (defun centaur-tabs-group-name-by-category ()
;; "Get tab group name based on category."
;; (let ((mode-category (get-category-name (current-buffer))))
;; (if mode-category
;; (list mode-category)
;; (list (get-project-name-or-default "main")))))
(defun centaur-tabs-projectile-buffer-groups ()
"Return the list of group names BUFFER belongs to."
(if centaur-tabs-projectile-buffer-group-calc
(symbol-value 'centaur-tabs-projectile-buffer-group-calc)
(set (make-local-variable 'centaur-tabs-projectile-buffer-group-calc)
(centaur-tabs-group-name-by-category))))
;; (defun centaur-tabs-projectile-buffer-groups ()
;; "Return the list of group names BUFFER belongs to."
;; (if centaur-tabs-projectile-buffer-group-calc
;; (symbol-value 'centaur-tabs-projectile-buffer-group-calc)
;; (set (make-local-variable 'centaur-tabs-projectile-buffer-group-calc)
;; (centaur-tabs-group-name-by-category))))
(add-hook! '(+doom-dashboard-mode-hook +popup-buffer-mode-hook)
(defun +tabs-disable-centaur-tabs-mode-maybe-h ()
"Disable `centaur-tabs-mode' in current buffer."
(when (centaur-tabs-mode-on-p)
(centaur-tabs-local-mode))))
)
;; (add-hook! '(+doom-dashboard-mode-hook +popup-buffer-mode-hook)
;; (defun +tabs-disable-centaur-tabs-mode-maybe-h ()
;; "Disable `centaur-tabs-mode' in current buffer."
;; (when (centaur-tabs-mode-on-p)
;; (centaur-tabs-local-mode))))
;; )
;; ruby

View file

@ -44,7 +44,7 @@
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;; tabs ; a tab bar for Emacs
tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter