It is frequently useful to post-process the fields in some way. Padding, limiting, cutting off parts and suppressing certain values can be achieved by using tilde modifiers. A typical tilde spec might look like ‘%~(cut 3)~(ignore "0")y’.
These are the valid modifiers:
Pad the field to the left with spaces until it reaches the required length.
Pad the field to the right with spaces until it reaches the required length.
Cut off characters from the left until it reaches the specified length.
Cut off characters from the right until it reaches the specified length.
Cut off the specified number of characters from the left.
Cut off the specified number of characters from the right.
Return an empty string if the field is equal to the specified value.
Use the specified form as the field value when the ‘@’ spec is used.
Here’s an example:
Let’s take an example. The ‘%o’ spec in the summary mode lines will return a date in compact ISO8601 format—‘19960809T230410’. This is quite a mouthful, so we want to shave off the century number and the time, leaving us with a six-character date. That would be ‘%~(cut-left 2)~(max-right 6)~(pad 6)o’. (Cutting is done before maxing, and we need the padding to ensure that the date is never less than 6 characters to make it look nice in columns.)
Ignoring is done first; then cutting; then maxing; and then as the very last operation, padding.