今まで頑なにTotalTerminal + KeyRemap4MacBookを使って来た私ですが、ついに乗り換えることにしました。
理由はKeyRemap4MacBookをバージョンアップしたら、一部のkey bindが使えなくなってしまったから。まあいい機会なので乗り換えたいと思います。
iterm2のバージョン
iterm2の公式ページからダウンロード
ダウンロードしたファイル解凍してみるとなぜか「tmux-for-iTerm2-20130122.tar.gz」というファイルも入っている。
iterm2の公式wikiで調べてみると、tmuxを使う場合、この「iTerm2用のtmux」じゃないと細かい挙動が期待どおりに動かないっぽい(適当)。
なので、このタイミングでScreenからtmuxにも乗り換えてみることにした。
brewでlibevnetのインストール
まず、こちらのサイト「Lionにiterm2とtmux と libeventをインストールする」を参考にlibenventをインストール。
brew update
brew install libevent
tmuxのインストール
さきほどダウンロードしたファイルを解凍し、make & install
tar xvzf tmux-for-iTerm2-20130122.tar.gz
cd tmux
./configure
make
make clean
sudo make install
念のためtmuxのインストール先を確認
which tmux
/usr/local/bin/tmux
iterm2の初期設定
今まで、KeyRemap4MacBookでcmdとoptionを入れ替えていて、操作上はcmdにmetaキーが割り振ってある感じにして使っていたんですが、このタイミングでoptionにmetaキーを割り当てることにしました。
ただ、それ以外の操作はできるかぎりTotalTerminalと同じようにしたいので、その設定をしていきます。
バックグラウンドを白にし、透過させる
Preferences > Profiles > Colors > Background
Preferences > Profiles > Window > Transparency
画面の上部からターミナルをショートカットで表示できるようにする
Preferences > Profiles > Window > Setting for New Window > Style > Top of Screen
Preferences > Profiles > Window > Setting for New Window > Space > All Spaces
Preferences > Profiles > Window > Setting for New Window > Rows > 70
Preferences > Keys > Hot key > Show/hide iTerm2 with a system-wide hotkey
metaキーをoptionに割り当てる
Preferences > Profiles > Keys > Left option > +Esc
Preferences > Profiles > Keys > Right option > +Esc
cmd + w ですぐにターミナルを終了しないようにする
Preferences > Profiles > Session > Always prompt before closing
参考サイト
以下のサイトを参考にさせていただきました。ありがとうございます!