Skip to content

Commit c446fbe

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

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

etc/tmux.conf

Lines changed: 19 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
@@ -62,7 +68,12 @@ set -g status-left "#[fg=white]@#h#[fg=red]:#S#[fg=white] |"
6268
#set -g status-right-length 16
6369
#set -g status-right '#[fg=yellow]%Y-%m-%d %H:%M'
6470
### status-right: IPs and Date and Time
65-
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' }
71+
if-shell 'command -v hostname && hostname --help | grep -q -- -I' {
72+
set -g status-right "#[fg=green](net: #(hostname -I | \
73+
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+
}
6677
### status-right: Time
6778
#set -g status-right-length 6
6879
#set -g status-right "#[fg=yellow]%H:%M"
@@ -71,5 +82,6 @@ set-window-option -g window-status-style fg=blue,bg=black
7182
set-window-option -g window-status-current-style bold
7283

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

0 commit comments

Comments
 (0)