Created
October 7, 2014 02:32
-
-
Save lamanotrama/f281350e604c9ab3a1df to your computer and use it in GitHub Desktop.
tmux auto rename window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## rename window to repo-name {{{ | |
# http://blog.manaten.net/entry/tmux-repository | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' enable git svn | |
zstyle ':vcs_info:*' formats '%r' | |
rename_tmux_window() { | |
[ -n "$TMUX" ] || return | |
LANG=en_US.UTF-8 vcs_info | |
if [[ -n "${vcs_info_msg_0_}" ]]; then | |
tmux rename-window "repo/$vcs_info_msg_0_" | |
else | |
tmux rename-window "osx" | |
fi | |
} | |
autoload -U add-zsh-hook | |
add-zsh-hook chpwd rename_tmux_window | |
if [ -n "$TMUX" ]; then | |
rename_tmux_window | |
fi | |
## }}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
formats既に使ってしまってたので,以下のように設定してみた
window名を
親ディレクトリ/現ディレクトリ
にしたかったので,当面はこれでいいや...