mirror of https://github.com/bjeanes/dotfiles.git
tmuz 'zooming'
parent
36748d0634
commit
eaca0bc519
2
Rakefile
2
Rakefile
|
@ -17,7 +17,7 @@ task :install do
|
|||
misc/ctags
|
||||
misc/inputrc
|
||||
misc/nanorc
|
||||
misc/tmux.conf
|
||||
misc/tmux/tmux.conf
|
||||
shells/bash/bash_profile
|
||||
shells/bash/bashrc
|
||||
shells/zsh/zshenv
|
||||
|
|
|
@ -12,10 +12,8 @@ set -g default-terminal "screen-256color"
|
|||
bind R source-file ~/.tmux.conf
|
||||
bind \ confirm-before kill-server
|
||||
|
||||
unbind Z
|
||||
bind Z new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom
|
||||
unbind z
|
||||
bind z last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom
|
||||
bind z run ". ~/.config/misc/tmux/zoom.sh"
|
||||
|
||||
# Mouse
|
||||
setw -g mode-mouse on
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash -f
|
||||
currentwindow=`tmux list-window | tr '\t' ' ' | sed -n -e '/(active)/s/^[^:]*: *\([^ ]*\) .*/\1/gp'`;
|
||||
currentpane=`tmux list-panes | sed -n -e '/(active)/s/^\([^:]*\):.*/\1/gp'`;
|
||||
panecount=`tmux list-panes | wc | sed -e 's/^ *//g' -e 's/ .*$//g'`;
|
||||
inzoom=`echo $currentwindow | sed -n -e '/^zoom/p'`;
|
||||
if [ $panecount -ne 1 ]; then
|
||||
inzoom="";
|
||||
fi
|
||||
if [ $inzoom ]; then
|
||||
lastpane=`echo $currentwindow | rev | cut -f 1 -d '@' | rev`;
|
||||
lastwindow=`echo $currentwindow | cut -f 2- -d '@' | rev | cut -f 2- -d '@' | rev`;
|
||||
tmux select-window -t $lastwindow;
|
||||
tmux select-pane -t $lastpane;
|
||||
tmux swap-pane -s $currentwindow;
|
||||
tmux kill-window -t $currentwindow;
|
||||
else
|
||||
newwindowname=zoom@$currentwindow@$currentpane;
|
||||
tmux new-window -d -n $newwindowname;
|
||||
tmux swap-pane -s $newwindowname;
|
||||
tmux select-window -t $newwindowname;
|
||||
fi
|
Loading…
Reference in New Issue