;; -*- lexical-binding: t; -*- ;;;; turn tabs on, undo/redo mode (setq tab-bar-show 1) (tab-bar-history-mode) ;;;; remove useless gui elements (setopt tab-bar-format '(tab-bar-format-tabs) tab-bar-close-button-show nil) ;;;; add useless text elements (setopt tab-bar-tab-hints t tab-bar-select-tab-modifiers '(meta)) ;;;; use project name if it exists (defun bd/tab-bar-name-function () (mapconcat (lambda (buffer) (let* ((file (buffer-file-name buffer)) (project (and file (project-current nil (file-name-directory (buffer-file-name buffer)))))) (if project (car (last (file-name-split (directory-file-name (project-root project))))) (tab-bar-tab-name-current)))) (delete-dups (mapcar #'window-buffer (window-list-1 (frame-first-window) 'nomini))) ", ")) (setopt project-switch-commands '((project-find-file "Find file") (project-find-regexp "Find regexp") (project-find-dir "Find directory") (magit-project-status "Magit") (project-shell "Shell"))) (keymap-global-set "C-x p v" 'magit-project-status) (setq tab-bar-tab-name-function #'bd/tab-bar-name-function) (provide 'bd--tabs)