diff --git a/init.example.el b/init.example.el index b524db899..e7dc5da14 100644 --- a/init.example.el +++ b/init.example.el @@ -56,6 +56,7 @@ nav-flash ; blink the current line after jumping evil-goggles ; display visual hints when editing in evil ;unicode ; extended unicode support for various languages + ;tabbar ; FIXME an (incomplete) tab bar for Emacs :tools dired ; making dired pretty [functional] diff --git a/modules/ui/tabbar/config.el b/modules/ui/tabbar/config.el new file mode 100644 index 000000000..d225f1316 --- /dev/null +++ b/modules/ui/tabbar/config.el @@ -0,0 +1,38 @@ +;;; ui/tabbar/config.el -*- lexical-binding: t; -*- + +;; This is here for reference. I don't use tabbar because it's unstable and not +;; very useful (all it does is show a buffer list on top of *every* window). I +;; find ivy (or helm) or even `buffer-menu' is better suited for this purpose. + +(def-package! tabbar + :demand t + :config + (setq tabbar-use-images nil) + (tabbar-mode) + + (defun +tabbar|disable-in-popups () + (when tabbar-mode + (tabbar-local-mode -1) + (setq-local header-line-format nil))) + (add-hook 'doom-popup-mode-hook #'+tabbar|disable-in-popups) + + (defun +tabbar-display-tab (tab) + "Return a label for TAB that resembles tabs in Atom." + (let ((label (if tabbar--buffer-show-groups + (format "[%s]" (tabbar-tab-tabset tab)) + (format "%s" (tabbar-tab-value tab)))) + (bar-color (face-background 'doom-modeline-bar nil t)) + (bar-height 25) + (bar-width 3) + (selected-p (eq tab (tabbar-selected-tab (tabbar-current-tabset))))) + (concat (when (and (display-graphic-p) selected-p) + (+doom-modeline--make-xpm bar-color bar-height bar-width)) + " " + (if tabbar-auto-scroll-flag + label + (tabbar-shorten + label (max 1 (/ (window-width) + (length (tabbar-view + (tabbar-current-tabset))))))) + " "))) + (setq tabbar-tab-label-function #'+tabbar-display-tab)) diff --git a/modules/ui/tabbar/packages.el b/modules/ui/tabbar/packages.el new file mode 100644 index 000000000..dee92b01b --- /dev/null +++ b/modules/ui/tabbar/packages.el @@ -0,0 +1,4 @@ +;; -*- no-byte-compile: t; -*- +;;; ui/tabbar/packages.el + +(package! tabbar)