File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,6 +200,33 @@ alias tn="tmux new-session -s \$(pwd | sed 's/.*\///g')"
200200alias td=" tmux detach"
201201alias mat=' osascript -e "tell application \"System Events\" to key code 126 using {command down}" && tmux neww "cmatrix"'
202202
203+ # Create a tmux layout for dev with editor, ai, and terminal
204+ tml () {
205+ local current_dir=" ${PWD} "
206+ local session_name=" ${current_dir##*/ } "
207+ local editor_pane ai_pane
208+ local ai=" opencode"
209+ # If not inside tmux, create a session and run tml inside it
210+ if [[ -z " $TMUX " ]]; then
211+ tmux new-session -d -s " $session_name " -c " $current_dir "
212+ tmux send-keys -t " $session_name " " tml $ai " C-m
213+ tmux attach -t " $session_name "
214+ return
215+ fi
216+
217+ # Already inside tmux — set up the layout
218+ editor_pane=$( tmux display-message -p ' #{pane_id}' )
219+ tmux split-window -v -p 15 -c " $current_dir "
220+
221+ tmux select-pane -t " $editor_pane "
222+ tmux split-window -h -p 30 -c " $current_dir "
223+ ai_pane=$( tmux display-message -p ' #{pane_id}' )
224+ tmux send-keys -t " $ai_pane " " $ai " C-m
225+ tmux send-keys -t " $editor_pane " " $EDITOR ." C-m
226+
227+ tmux select-pane -t " $editor_pane "
228+ }
229+
203230# Password generation
204231pg () {
205232 local password
You can’t perform that action at this time.
0 commit comments