Skip to content

Instantly share code, notes, and snippets.

@hjking
Forked from 3demax/tabbar-tweak.el
Created July 5, 2014 14:47
Show Gist options
  • Select an option

  • Save hjking/e276cf6ecb0b89c1d46c to your computer and use it in GitHub Desktop.

Select an option

Save hjking/e276cf6ecb0b89c1d46c to your computer and use it in GitHub Desktop.

Revisions

  1. @3demax 3demax revised this gist Oct 5, 2011. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions tabbar-tweak.el
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    ;; 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
  2. @3demax 3demax created this gist Oct 5, 2011.
    54 changes: 54 additions & 0 deletions tabbar-tweak.el
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    ;; 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)