Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save delianides/925ab5bbcec105c3416f1db7013608ea to your computer and use it in GitHub Desktop.
Save delianides/925ab5bbcec105c3416f1db7013608ea to your computer and use it in GitHub Desktop.
Start Local Tmux
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