mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-05 19:05:33 +01:00
Manage Build Configs with Build Configs
This commit is contained in:
parent
ed36ac2e28
commit
8818baed58
4 changed files with 100 additions and 20 deletions
11
.tmux
11
.tmux
|
@ -7,21 +7,18 @@ session_name="${1:-'build-configs'}"
|
|||
session_path="${2:-$(pwd)}"
|
||||
|
||||
if tmux has-session -t="${session_name}" 2> /dev/null; then
|
||||
tmux attach -t "${session_name}"
|
||||
tmux switch-client -t "${session_name}" 2> /dev/null ||
|
||||
tmux attach -t "${session_name}"
|
||||
exit
|
||||
fi
|
||||
|
||||
tmux new-session -d -s "${session_name}" -n vim -c "${session_path}"
|
||||
|
||||
# 1. Main window: Vim.
|
||||
tmux send-keys -t "${session_name}:vim" "nvim +GoToFile" Enter
|
||||
tmux send-keys -t "${session_name}:vim" "nvim" Enter
|
||||
|
||||
# 2. General shell use.
|
||||
tmux new-window -t "${session_name}" -c "${session_path}"
|
||||
|
||||
if [[ -n "${TMUX:-}" ]]; then
|
||||
tmux switch-client -t "${session_name}"
|
||||
tmux select-window -t "${session_name}:vim.left"
|
||||
else
|
||||
tmux switch-client -t "${session_name}:vim.left" ||
|
||||
tmux attach -t "${session_name}:vim.left"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue