memo.xight.org

日々のメモ

powerline の導入

Summary

powerlineを使って、tmux, vim, iTermのステータスバーを統一したい。
iTermについては、文字化けを防ぐためにフォントにパッチを当てる必要がある。

準備

-- grep のインストール

brew tap homebrew/dupes
brew install homebrew/dupes/grep

powerline用フォントの作成

brew install fontforge
fontforge -script ~/.vim/bundle/powerline/font/fontpatcher.py SourceCodePro-Regular.otf

fontpatcher.py が作成したpowerline用フォントをインストール。

iTerm

[Preferences...] - [Profiles] - [Text] - [Change Font]で powerline用フォントを選択

.vimrc

NeoBundle 'alpaca-tc/alpaca_powertabline'
NeoBundle 'Lokaltog/powerline', { 'rtp' : 'powerline/bindings/vim'}

tmux

git clone https://github.com/erikw/tmux-powerline.git

.tmux.conf

set-option -g status on
set-option -g status-interval 2
set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#(~/path/to/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/path/to/tmux-powerline/powerline.sh right)"

.tmux-powerlinerc

/path/to/repos/tmux-powerline/generate_rc.sh
/path/to/repos/tmux-powerline/segments/weather.sh: line 9: shell_is_bsd: command not found
Default configuration file generated to: $HOME/.tmux-powerlinerc.default
Copy/move it to "$HOME/.tmux-powerlinerc" and make your changes.

東京の天気予報を表示させる場合
Yahoo! Weather のURLを参照して天気予報を取得する
http://weather.yahoo.com/japan/tokyo-prefecture/tokyo-1118370/

export TMUX_POWERLINE_SEG_WEATHER_LOCATION="1118370"

Reference

GitHub - tmux-powerline
https://github.com/erikw/tmux-powerline.git

Qiita - Vim - powerlineをいつ使う? 今でしょ!
http://qiita.com/alpaca_taichou/items/ab70f914a6a577e25d70