Created
May 25, 2020 16:44
-
-
Save delianides/925ab5bbcec105c3416f1db7013608ea to your computer and use it in GitHub Desktop.
Start Local Tmux
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
function start-local() { | |
# start from current directoy | |
local directory=$(pwd) | |
if [[ -z $(which tmux) ]]; then | |
echo 'TMUX is not running!' | |
return | |
else | |
if ! _tmux_session_exists 'local'; then | |
tmux new-session -d -s 'local' -n 'code' -c "$directory" | |
tmux select-window -t 'code' | |
# tmux split-window -h -p 40 | |
# tmux select-pane -t 2 | |
# tmux split-window -v -p 25 | |
# tmux select-pane -t 1 | |
fi | |
tmux attach-session -d -t 'local' | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment