mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Add tds 4-way
This commit is contained in:
@@ -34,6 +34,33 @@ tdl() {
|
||||
tmux send-keys -t "$editor_pane" "$EDITOR ." C-m
|
||||
|
||||
# Select the nvim pane for focus
|
||||
tmux select-pane -t "$opencode_pane"
|
||||
}
|
||||
|
||||
# Create a Tmux Dev Square layout with editor, diff watch, terminal, and opencode
|
||||
# Usage: tds
|
||||
tds() {
|
||||
[[ -n $1 ]] && { echo "Usage: tds"; return 1; }
|
||||
[[ -z $TMUX ]] && { echo "You must start tmux to use tds."; return 1; }
|
||||
|
||||
local current_dir="${PWD}"
|
||||
local editor_pane diff_pane terminal_pane opencode_pane
|
||||
|
||||
editor_pane="$TMUX_PANE"
|
||||
|
||||
tmux rename-window -t "$editor_pane" "$(basename "$current_dir")"
|
||||
|
||||
terminal_pane=$(tmux split-window -v -p 50 -t "$editor_pane" -c "$current_dir" -P -F '#{pane_id}')
|
||||
diff_pane=$(tmux split-window -h -p 50 -t "$editor_pane" -c "$current_dir" -P -F '#{pane_id}')
|
||||
opencode_pane=$(tmux split-window -h -p 50 -t "$terminal_pane" -c "$current_dir" -P -F '#{pane_id}')
|
||||
|
||||
tmux send-keys -t "$editor_pane" -l "nvim ."
|
||||
tmux send-keys -t "$editor_pane" C-m
|
||||
tmux send-keys -t "$diff_pane" -l "hunk diff --watch"
|
||||
tmux send-keys -t "$diff_pane" C-m
|
||||
tmux send-keys -t "$opencode_pane" -l "opencode"
|
||||
tmux send-keys -t "$opencode_pane" C-m
|
||||
|
||||
tmux select-pane -t "$editor_pane"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user