?
- Conditionals, if a variable exists and non-zero, then the first is chosen, otherwise second.
Example: #{?session_attached,attached,not attached}
.
==:
, !=:
, <:
, >:
, <=:
, >=:
- String comparisons.
Example #{==:#{host},nixos}
will be either 1
or 0
.
||:
, &&:
- Logical AND
s and OR
s.
Example #{||:#{pane_in_mode},#{alternate_on}}
.
m:
- fnmatch(3)
comparison, example #{m:*foo*,#{host}}
.
m/r:
- Regular expressions matching, example #{m/r:^foo.*$,#{pane_current_path}}
.
m/i:
- Ignore the case.
m/ri:
- Combine Regular expressions and ignoring the case.
s/foo/bar/i:
- Substitute foo
with bar
ignoring the case, similar to sed
.
It is possible to use a different separator character, e.g. #{s|/home/igor|~:pane_current_path}
.
C:
- Search in for the pane content using fnmatch(3)
, return line number if found, 0
otherwise.
C/r:
- The same as the previous, but using Regular expressions, example #{C/r:^Start}
.
C/i:
- Ignore the case.
C/ri:
- Combine Regular expressions and ignoring the case.\
e|+|:
, e|-|:
, e|*|:
, e|/|:
, e|m|:
(Modulus operation), e|==|:
, e|!=|:
, e|<|:
, e|>|:
, e|<=|:
, e|=>|:
- Numerical operations, integers only.
Example #{e|+|:5,3}
.
e|+|f:
- Floating numbers, example #{e|*|,2.5,2}
.
e|+|f|4:
- Specify decimal output size for a result.
=5:
- Limit a string to 5 characters starting from the beginning.
=-5:
- Limit a string to 5 characters taking the last 5 characters.
=/5/...:
- Limit a string to 5 characters, and if trimmed then append ...
, for example #{=/5/...:pane_current_path}
turns to /home...
.
=/-5/...:
- Limit a string to 5 characters from the tail, and if trimmed then prepend ...
, for example #{=/-5/...:pane_current_path}
turns to ...files
.
b:
- Extract a basename, for example #{b:pane_current_path}
turns to dotfiles
.
d:
- Extract a dirname, for example #{d:pane_current_path}
turns to /home/igor/personal
.
S:
- Loop over sessions, append strings to each other.
W:
- Loop over windows, append strings to each other.
If one argument, then loop over all: #{W: #{pane_id} }
.
If two arguments, then loop separately over active and inactive: #{W: window-#W-active , window-#W-inactive }
.
P:
- Same as for W
but for panes.
If one argument, then loop over all: #{P:#{pane_id}
.
If two arguments, then loop separately over active and inactive: #{P: pane-id-#D-active , pane-id-#D-inactive }
.