Spica*

プログラミングの話。

Mac OS XにTmux powerline入れた

f:id:esperia:20150107204654p:plain

会社のパソコン新しいの使うようになったのでターミナルもかっこよくしたくなったので! 例によって Homebrew は入ってること前提です。

Powerlineのインストール

$ brew install python
$ pip install git+git://github.com/Lokaltog/powerline

Installation on OS X — Powerline beta documentation あたりに書いてあります。

powerline/fonts のインストール

$ git clone https://github.com/powerline/fonts.git
$ cd fonts
$ ./install.sh

上記でOK、次にターミナルで利用するフォントを変更。 僕はiTerm使ってるので以下の様な感じ。

f:id:esperia:20150107204544p:plain

Source Code Pro for Powerline を選択すればおkです。

Tmux statusline のインストール

Tmux statuslineのページを見ると、tmuxの設定ファイル( ~/.tmux.conf )へ、 source "{repository_root}/powerline/bindings/tmux/powerline.conf" を追加すれば良いみたいに書いてる。 以下を実行して、powerlineのインストール先を調べて、

$ pip show powerline-status
---
Name: powerline-status
Version: dev-4b4964013be7f5205382b4a0a8595e2e0df19eb7
Location: /usr/local/lib/python2.7/site-packages
Requires:

{repository_root} を、 Location: のところに出たパスで置き換えた文字列を、 .tmux.conf へ追記。

$ echo 'source "/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"' >> .tmux.conf

あと、なんか以下のパッケージもないとtmux起動した時にエラー出るので入れる。

$ pip install psutil

起動!

$ tmux

かっこいい!!ステキ!!