Created
October 5, 2011 14:58
-
-
Save 3demax/1264635 to your computer and use it in GitHub Desktop.
Emacs tabbar-mode visual tweaks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 "gray20" | |
: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) |
It is really cool!
How can I resize height of the tabbar? :(
@darvein Resize height of the tabbar this way:
(set-face-attribute
'tabbar-default nil
:background "gray20"
:foreground "gray20"
:box '(:line-width 1 :color "gray20" :style nil)
:height 1.3)
error: Invalid face, tabbar-default
with emacsw64
move (tabbar-mode 1)
to before set-face-attribute
fixes the 'invalid face' error.
How would I enable this for the tabbar-ruler package?
Thanks very much for this! Is there a license that you've assigned to this? I'd like to incorporate it into a GPLv3-licensed project I'm working on, and so would like to check with you about your expectations for this gist.
Thank you very much!
thank you very much!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the tabbar-buffer-tab-label!