mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add the tmux dev layout
This commit is contained in:
@@ -108,3 +108,41 @@ dip() {
|
||||
lip() {
|
||||
pgrep -af "ssh.*-L [0-9]+:localhost:[0-9]+" || echo "No active forwards"
|
||||
}
|
||||
|
||||
# Create a tmux layout for dev with editor, ai, and terminal
|
||||
tml() {
|
||||
local current_dir="${PWD}"
|
||||
local editor_pane ai_pane
|
||||
local ai="$1"
|
||||
|
||||
# Get current pane ID (will become editor pane after splits)
|
||||
editor_pane=$(tmux display-message -p '#{pane_id}')
|
||||
|
||||
# Split window vertically - top 90%, bottom 10%
|
||||
tmux split-window -v -p 10 -c "$current_dir"
|
||||
|
||||
# Go back to top pane (editor_pane) and split it horizontally
|
||||
tmux select-pane -t "$editor_pane"
|
||||
tmux split-window -h -p 30 -c "$current_dir"
|
||||
|
||||
# After horizontal split, cursor is in the right pane (new pane)
|
||||
# Get its ID and run ai there
|
||||
ai_pane=$(tmux display-message -p '#{pane_id}')
|
||||
tmux send-keys -t "$ai_pane" "$ai" C-m
|
||||
|
||||
# Run nvim in the left pane
|
||||
tmux send-keys -t "$editor_pane" "$EDITOR ." C-m
|
||||
|
||||
# Select the nvim pane for focus
|
||||
tmux select-pane -t "$editor_pane"
|
||||
}
|
||||
|
||||
# Create a dev layout using tmux with editor, opencode, and terminal
|
||||
nic() {
|
||||
tml c
|
||||
}
|
||||
|
||||
# Create a dev layout using tmux with editor, claude, and terminal
|
||||
nicx() {
|
||||
tml cx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user