-
-
Save anosatsuk124/4b011271deb65a6e40423515c7faedea to your computer and use it in GitHub Desktop.
This is my tmux configuration that makes your terminal the ide-like usage.
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
#! /bin/sh | |
CURRENT_WINDOW=$(tmux display-message -p '#I') | |
if [ "$1" = "kill" ] ; then | |
PANES_LENGTH=$(($(tmux list-panes | wc -l) - 1)) | |
tmux swap-pane -s 0 -t $PANES_LENGTH | |
for i in $(seq 0 $(($PANES_LENGTH - 2))); do | |
nohup tmux kill-pane -t $i > /dev/null 2>&1 & | |
done | |
nohup tmux kill-pane -t 0 > /dev/null 2>&1 & | |
elif [ "$1" = "rename" ] ; then | |
tmux rename-window -t $CURRENT_WINDOW $2 | |
else | |
CURRENT_PANE=$(tmux display-message -p '#P') | |
tmux splitw -v -d -t $CURRENT_PANE -c '#{pane_current_path}' | |
tmux splitw -h -d -t $CURRENT_PANE -c '#{pane_current_path}' | |
CURRENT_PANE=$(($CURRENT_PANE + 2)) | |
for i in $(seq 0 0); do | |
TEMP_PANE=$((${CURRENT_PANE} + $i)) | |
tmux splitw -h -d -t $TEMP_PANE -c '#{pane_current_path}' | |
done | |
tmux resize-pane -t 0 -D 15 | |
tmux resize-pane -t 0 -R 25 | |
PANES_LENGTH=$(tmux list-panes | wc -l) | |
for i in $(seq 1 $(($PANES_LENGTH - 1))); do | |
tmux send-keys -t $i clear Enter | |
done | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment