12FF5B8

hico_horiuchiの技術系な覚え書き.

Emacsにタブ機能を追加するtabbar.elの導入

Emacsにタブ機能を追加するtabbar.elを導入した。
EmacsWiki: tabbar.elからtabbar.elをダウンロードして、load-pathの通った場所に置く。

~/.emacs.d/init.elに、以下の設定を追加する。

(require 'tabbar)
(tabbar-mode)
(global-set-key "\M-]" 'tabbar-forward)  ; 次のタブ
(global-set-key "\M-[" 'tabbar-backward) ; 前のタブ
;; タブ上でマウスホイールを使わない
(tabbar-mwheel-mode nil)
;; グループを使わない
(setq tabbar-buffer-groups-function nil)
;; 左側のボタンを消す
(dolist (btn '(tabbar-buffer-home-button
               tabbar-scroll-left-button
               tabbar-scroll-right-button))
  (set btn (cons (cons "" nil)
                 (cons "" nil))))
;; 色設定
(set-face-attribute ; バー自体の色
  'tabbar-default nil
   :background "white"
   :family "Inconsolata"
   :height 1.0)
(set-face-attribute ; アクティブなタブ
  'tabbar-selected nil
   :background "black"
   :foreground "white"
   :weight 'bold
   :box nil)
(set-face-attribute ; 非アクティブなタブ
  'tabbar-unselected nil
   :background "white"
   :foreground "black"
   :box nil)

色設定の部分で、シンプルな白黒の配色にしている。
'tabbar-defaultの:familyでフォントを、heightでフォントサイズを設定できる。
(:height 1.0で、バッファと同じフォントサイズになる。)