Skip to content

Commit c738211

Browse files
committed
tmux.conf: use brackets for if-shell commands
* it's easier to read \ó/
1 parent c4eabbf commit c738211

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

etc/tmux.conf

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ bind-key j join-pane -s !
2727
bind-key J join-pane
2828

2929
### Move current window to session named "bg" (and create session if it does not exist)
30-
bind-key B if-shell "! tmux has-session -t bg" "new-session -d -s bg" \; move-window -t bg
30+
bind-key B if-shell '! tmux has-session -t bg' {
31+
new-session -d -s bg
32+
move-window -t bg
33+
}
3134

32-
### Reload Config
33-
if-shell "! (env | grep -q TMUX=/tmp/tmate)" \
34-
"bind-key R source-file ~/.tmux.conf \\; source-file -q ~/.tmux.conf.local \\; display-message '~/.tmux.conf[.local] reloaded'"
35+
### Reload User Configs
36+
if-shell '! (env | grep -q TMUX=/tmp/tmate)' {
37+
bind-key R source-file ~/.tmux.conf
38+
source-file -q ~/.tmux.conf.local
39+
display-message "~/.tmux.conf[.local] reloaded"
40+
}
3541

3642
###rebind keys
3743
bind-key h next-layout
@@ -63,13 +69,18 @@ set -g status-left "#[fg=white]@#h#[fg=red]:#S#[fg=white] |"
6369
#set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M'
6470
### status-right: IPs and Date and Time
6571
set -g status-right-length 64
66-
if-shell "command -v hostname && hostname --help | grep -q -- -I" { set -g status-right "#[fg=green](net: #(hostname -I | sed -e 's/ [^ ]*:.*$//;s/ / | /g;s/ | $//')) #[fg=yellow]%Y-%m-%d %H:%M" } { set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M' }
72+
if-shell 'command -v hostname && hostname --help | grep -q -- -I' {
73+
set -g status-right "#[fg=green](net: #(hostname -I | sed -e 's/ [^ ]*:.*$//;s/ / | /g;s/ | $//')) #[fg=yellow]%Y-%m-%d %H:%M"
74+
} {
75+
set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M'
76+
}
6777
### status-right: Time
6878
#set -g status-right "#[fg=yellow]%H:%M"
6979

7080
set-window-option -g window-status-style fg=blue,bg=black
7181
set-window-option -g window-status-current-style bold
7282

7383
### source user-specific local configuration file
74-
if-shell "! (env | grep -q TMUX=/tmp/tmate)" \
75-
"source-file -q ~/.tmux.conf.local"
84+
if-shell '! (env | grep -q TMUX=/tmp/tmate)' {
85+
source-file -q ~/.tmux.conf.local
86+
}

0 commit comments

Comments
 (0)