Skip to content

Commit

Permalink
configs: tmux: Use braces for sections to reduce need for quoting
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 24, 2024
1 parent 0655732 commit 8adc1d0
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions configs/tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@ bind-key c new-window dbxe
bind-key C new-window

# open specific distrobox container using N
bind-key N command-prompt -p "distrobox container:" "new-window 'dbxe %1; or exec fish -l'"
bind-key E command-prompt -p "new ephemeral distrobox container:" "new-window 'dbxeph %1'"
bind-key N {
command-prompt -p "distrobox container:" {
new-window 'dbxe %1; or exec fish -l'
}
}
bind-key E {
command-prompt -p "new ephemeral distrobox container:" {
new-window 'dbxeph %1'
}
}

# run commands in either host or distrobox
bind-key r command-prompt -p "run command (distrobox):" "new-window 'dbxe -- fish -c \"begin; %1; end; or exec fish -l\"; or exec fish -l'"
bind-key R command-prompt -p "run command (host):" "new-window 'begin; %1; end; or exec fish -l'"
bind-key r {
command-prompt -p "run command (distrobox):" {
new-window 'dbxe -- fish -c "begin; %1; end; or exec fish -l"'
}
}
bind-key R {
command-prompt -p "run command (host):" {
new-window 'begin; %1; end; or exec fish -l'
}
}

# split panes using | and - (distrobox) and H and V (host)
bind-key | split-window -h dbxe
Expand Down Expand Up @@ -48,12 +64,14 @@ set-window-option -g window-status-style "fg=#FFFFFF,bg=default,default"
# Make certain changes if we are running in a VM, as the session might be nested
# VM: Set window style to red
# Other platforms: Set prefix to "Ctrl + Space" and set window style to blue
if-shell '[ "$LOCATION" = "vm" ]' \
"set-window-option -g window-status-current-style fg=red,bg=default,bold" \
"unbind C-b; \
set-option -g prefix C-Space; \
bind-key C-Space send-prefix; \
set-window-option -g window-status-current-style fg=blue,bg=default,bold"
if-shell '[ "$LOCATION" = "vm" ]' {
set-window-option -g window-status-current-style fg=red,bg=default,bold
} {
unbind C-b; \
set-option -g prefix C-Space; \
bind-key C-Space send-prefix; \
set-window-option -g window-status-current-style fg=blue,bg=default,bold
}
set-option -g message-style "fg=#FFFFFF,bg=default,bright"
set -g status-left " "
set -g status-justify left
Expand Down

0 comments on commit 8adc1d0

Please sign in to comment.