forked from amaranth0203/Sources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabbar-tweak.el
executable file
·59 lines (56 loc) · 1.91 KB
/
tabbar-tweak.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;; This are setting for nice tabbar items
;; to have an idea of what it looks like http://imgur.com/b0SNN
;; inspired by Amit Patel screenshot http://www.emacswiki.org/pics/static/NyanModeWithCustomBackground.png
;; Tabbar
(require 'tabbar)
;; Tabbar settings
(set-face-attribute
'tabbar-default nil
;;:background "gray0"
;; :foreground "gray20"
;; :box '(:line-width 1 :color "gray20" :style nil)
)
;; (set-face-attribute
;; 'tabbar-unselected nil
;; ; :background "gray30"
;; :foreground "white"
;; :box '(:line-width 5 :color "gray30" :style nil))
;; (set-face-attribute
;; 'tabbar-selected nil
;; ; :background "gray75"
;; :foreground "black"
;; :box '(:line-width 5 :color "gray75" :style nil))
;; (set-face-attribute
;; 'tabbar-highlight nil
;; :background "white"
;; :foreground "black"
;; :underline nil
;; :box '(:line-width 5 :color "white" :style nil))
;; (set-face-attribute
;; 'tabbar-button nil
;; :box '(:line-width 1 :color "gray20" :style nil))
;; (set-face-attribute
;; 'tabbar-separator nil
;; :background "gray20"
;; :height 0.6)
;; Change padding of the tabs
;; we also need to set separator to avoid overlapping tabs by highlighted tabs
(custom-set-variables
'(tabbar-separator (quote (0.5))))
;; adding spaces
(defun tabbar-buffer-tab-label (tab)
"Return a label for TAB.
That is, a string used to represent it on the tab bar."
(let ((label (if tabbar--buffer-show-groups
(format "[%s] " (tabbar-tab-tabset tab))
(format "%s " (tabbar-tab-value tab)))))
;; Unless the tab bar auto scrolls to keep the selected tab
;; visible, shorten the tab label to keep as many tabs as possible
;; in the visible area of the tab bar.
(if tabbar-auto-scroll-flag
label
(tabbar-shorten
label (max 1 (/ (window-width)
(length (tabbar-view
(tabbar-current-tabset)))))))))
(tabbar-mode 1)