[tmux] ペイン移動,削除の際にウィンドウ名をリネームする ref: http://qiita.com/ssh0/items/b12afb372ac48814a17a
This file contains 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
# if session has > 1 windows in current, kill-pane without confirmation. | |
# But confirm before killing pane when it is the last pane in the window. | |
bind-key -n M-c if "tmux display -p \"#{window_panes}\" | grep ^1\$" \ | |
"confirm-before -p \"Kill the only pane in the window? It will kill this window too. (y/n)\" kill-pane" \ | |
"kill-pane \; run 'tmux rename-window \"#{pane_current_command}\"'" | |
# move between panes with Alt+j/k | |
bind-key -n M-j select-pane -t :.+ \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-k select-pane -t :.- \; run 'tmux rename-window "#{pane_current_command}"' | |
# join pane with Alt+H/L | |
bind-key -n M-L join-pane -t :+ \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-H join-pane -t :- \; run 'tmux rename-window "#{pane_current_command}"' | |
# swap pane to Alt+shift+number | |
bind-key -n M-! join-pane -t :1 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-'"' join-pane -t :2 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-'#' join-pane -t :3 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-'$' join-pane -t :4 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-% join-pane -t :5 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-& join-pane -t :6 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-"'" join-pane -t :7 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-( join-pane -t :8 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-) join-pane -t :9 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-( join-pane -t :8 \; run 'tmux rename-window "#{pane_current_command}"' | |
bind-key -n M-) join-pane -t :9 \; run 'tmux rename-window "#{pane_current_command}"' |
This file contains 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
run 'tmux rename-window "#{pane_current_command}"' |
This file contains 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 "#{pane_current_command}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment