Add ui/tabbar

This commit is contained in:
Henrik Lissner 2017-06-29 14:55:24 +02:00
parent fa47730204
commit 7fc9cb5511
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 43 additions and 0 deletions

View file

@ -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]

View 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))

View file

@ -0,0 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; ui/tabbar/packages.el
(package! tabbar)