aboutsummaryrefslogtreecommitdiff
path: root/tmux.1
diff options
context:
space:
mode:
authornicm <nicm>2017-10-06 18:02:30 +0000
committernicm <nicm>2017-10-06 18:02:30 +0000
commit9c4caf49a2e65ca03efe67332493de28c177be14 (patch)
tree9e34a58f1d599553a0d3a08a295b4a6b7b9710a3 /tmux.1
parentb462063cd59647e7f98eb11bde9bb0fef41bb2bd (diff)
downloadrtmux-9c4caf49a2e65ca03efe67332493de28c177be14.tar.gz
rtmux-9c4caf49a2e65ca03efe67332493de28c177be14.tar.bz2
rtmux-9c4caf49a2e65ca03efe67332493de28c177be14.zip
Support %else in config files to match %if, from Brad Town in GitHub
issue 1071.
Diffstat (limited to 'tmux.1')
-rw-r--r--tmux.125
1 files changed, 20 insertions, 5 deletions
diff --git a/tmux.1 b/tmux.1
index 45eb83b2..218a16d2 100644
--- a/tmux.1
+++ b/tmux.1
@@ -976,22 +976,37 @@ them with
and
.Em %endif
lines.
+Additional
+.Em %elif
+and
+.Em %else
+lines may also be used.
The argument to
.Em %if
-is expanded as a format and if it evaluates to false
-(zero or empty), subsequent lines are ignored until
+and
+.Em %elif
+is expanded as a format and if it evaluates to false (zero or empty),
+subsequent lines are ignored until the next
+.Em %elif ,
+.Em %else
+or
.Em %endif .
For example:
.Bd -literal -offset indent
%if #{==:#{host},myhost}
set -g status-style bg=red
+%elif #{==:#{host},myotherhost}
+set -g status-style bg=green
+%else
+set -g status-style bg=blue
%endif
.Ed
.Pp
Will change the status line to red if running on
-.Ql myhost .
-.Em %if
-may not be nested.
+.Ql myhost ,
+green if running on
+.Ql myotherhost ,
+or blue if running on another host.
.It Ic start-server
.D1 (alias: Ic start )
Start the