Add ui/tabbar
This commit is contained in:
parent
fa47730204
commit
7fc9cb5511
3 changed files with 43 additions and 0 deletions
|
@ -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]
|
||||
|
|
38
modules/ui/tabbar/config.el
Normal file
38
modules/ui/tabbar/config.el
Normal file
|
@ -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))
|
4
modules/ui/tabbar/packages.el
Normal file
4
modules/ui/tabbar/packages.el
Normal file
|
@ -0,0 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; ui/tabbar/packages.el
|
||||
|
||||
(package! tabbar)
|
Loading…
Add table
Add a link
Reference in a new issue