2023-12-25 21:56:28 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
|
|
|
|
session_name="${1:-atdc}"
|
|
|
|
session_path="${2:-$(pwd)}"
|
|
|
|
|
|
|
|
if tmux has-session -t="${session_name}" 2> /dev/null; then
|
2024-01-29 22:05:52 +00:00
|
|
|
tmux attach -t "${session_name}" ||
|
|
|
|
tmux switch-client -t "${session_name}"
|
2023-12-25 21:56:28 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
tmux new-session -d -s "${session_name}" -n vim -c "${session_path}"
|
|
|
|
|
2024-01-29 22:05:52 +00:00
|
|
|
# 1. Main window: Vim.
|
2024-01-15 08:00:00 +00:00
|
|
|
tmux send-keys -t "${session_name}:vim" "nvim" Enter
|
2024-01-15 10:09:49 +00:00
|
|
|
tmux split-pane -t "${session_name}:vim" -h -c "${session_path}" -p 40
|
2024-01-29 22:05:52 +00:00
|
|
|
tmux send-keys -t "${session_name}:vim.right" "./run start" Enter
|
2023-12-25 21:56:28 +00:00
|
|
|
|
|
|
|
# 2. General shell use.
|
|
|
|
tmux new-window -t "${session_name}" -c "${session_path}"
|
|
|
|
|
|
|
|
tmux switch-client -t "${session_name}:vim.left" ||
|
|
|
|
tmux attach -t "${session_name}:vim.left"
|
2024-01-29 22:05:52 +00:00
|
|
|
|
|
|
|
# vim: ft=bash
|