Created
May 17, 2021 11:55
-
-
Save owulveryck/511fda16e0ccfce55f43257dd63795de to your computer and use it in GitHub Desktop.
shell wrapper to trigger my dev tools
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
#!/bin/zsh | |
if [ ! "$TMUX" ]; then | |
tmux new-session $0 $@ | |
exit | |
fi | |
tmux new-window -n "vim $@" | |
LASTWINDOW=$(tmux list-windows | sort -k 8 | tail -1 | sed 's/\([0-9]*\):.*/\1/') | |
tmux select-window -t :$LASTWINDOW | |
tmux send-keys -t :$LASTWINDOW "vim $@" C-m | |
tmux split-window -v | |
tmux resize-pane -y 15 | |
tmux select-pane -t 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment