tmuxでウインドウを新しく作ったり分割したりするときにカレントディレクトリにいる状態で開く設定です。
バージョンが1.8以下だとデフォルトでカレントディレクトリで開いてくれますが、1.9以上だとpane_current_path
を使う必要があります。
bind-key S split-window -c "#{pane_current_path}"\
bind-key | split-window -h -c "#{pane_current_path}"\
bind-key C-c new-window -c "#{pane_current_path}"\
参考ページ
pane_current_pathについて
https://qiita.com/bomcat/items/73de1105f7ffa0f93863
蛇足
if-shell
を使ってバージョン1.9以上のときだけ上記の設定を反映するのを試してみましたがうまく動きませんでした。
bind-key S split-window
bind-key | split-window -h
bind-key C-c new-window
if-shell "[[ `tmux -V | cut -d' ' -f2` -ge 1.9 ]]" '\
bind-key S split-window -c "#{pane_current_path}"\
bind-key | split-window -h -c "#{pane_current_path}"\
bind-key C-c new-window -c "#{pane_current_path}"\
'
man-page
http://man.openbsd.org/OpenBSD-current/man1/tmux.1#if-shell