aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-09-06 07:33:21 +0200
committerRobin Jarry <robin@jarry.cc>2023-01-06 22:56:47 +0100
commit535300cfdbfc6e72fe9717c409fa64f072a1c581 (patch)
treedadcb1c1d88406134e532ab0f6cd87e54ff659d7 /doc
parent012be0192c88f4fcfd5ed559edff4ca7366eb351 (diff)
downloadaerc-535300cfdbfc6e72fe9717c409fa64f072a1c581.tar.gz
config: add columns based index format
The index-format option comes from mutt and is neither user friendly, nor intuitive. Introduce a new way of configuring the message list contents. Replace index-format with multiple settings to make everything more intuitive. Reuse the table widget added in the previous commit. index-columns Comma-separated list of column names followed by optional alignment and width specifiers. column-separator String separator between columns. column-$name One setting for every name defined in index-columns. This supports golang text/template syntax and allows access to the same message information than before and much more. When index-format is still defined in aerc.conf (which will most likely happen when users will update after this patch), convert it to the new index-columns + column-$name and column-separator system and a warning is displayed on startup so that users are aware that they need to update their config. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/aerc-config.5.scd80
1 files changed, 35 insertions, 45 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index dcaa3dd4..7e189a48 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -66,53 +66,43 @@ These options are configured in the *[general]* section of _aerc.conf_.
These options are configured in the *[ui]* section of _aerc.conf_.
-*index-format* = _<format>_
- Describes the format for each row in a mailbox view. This field is
- compatible with mutt's printf-like syntax.
+*index-columns* = _<column1,column2,column3...>_
+ Describes the format for each row in a mailbox view. This is a comma
+ separated list of column names with an optional align and width suffix.
+ After the column name, one of the _<_ (left), _:_ (center) or _>_
+ (right) alignment characters can be added (by default, left) followed by
+ an optional width specifier. The width is either an integer representing
+ a fixed number of characters, or a percentage between _1%_ and _99%_
+ representing a fraction of the terminal width. It can also be one of the
+ _\*_ (auto) or _=_ (fit) special width specifiers. Auto width columns
+ will be equally attributed the remaining terminal width. Fit width
+ columns take the width of their contents. If no width specifier is set,
+ _\*_ is used by default.
- Default: _%D %-17.17n %s_
+ Default: _date<20,name<17,flags>4,subject<\*_
-[- *Format specifier*
-:[ *Description*
-| _%%_
-: literal %
-| _%a_
-: sender address
-| _%A_
-: reply-to address, or sender address if none
-| _%C_
-: message number
-| _%d_
-: formatted message timestamp
-| _%D_
-: formatted message timestamp converted to local timezone
-| _%f_
-: sender name and address
-| _%F_
-: author name, or recipient name if the message is from you.
- The address is shown if no name part.
-| _%g_
-: message labels (for example notmuch tags)
-| _%i_
-: message id
-| _%n_
-: sender name, or sender address if none
-| _%r_
-: comma-separated list of formatted recipient names and addresses
-| _%R_
-: comma-separated list of formatted CC names and addresses
-| _%s_
-: subject
-| _%t_
-: the (first) address the new email was sent to
-| _%T_
-: the account name which received the email
-| _%u_
-: sender mailbox name (e.g. "smith" in "smith@example.net")
-| _%v_
-: sender first name (e.g. "Alex" in "Alex Smith <smith@example.net>")
-| _%Z_
-: flags (O=old, N=new, r=answered, D=deleted, !=flagged, \*=marked, a=attachment)
+*column-separator* = _"<separator>"_
+ String separator inserted between columns. When a column width specifier
+ is an exact number of characters, the separator is added to it (i.e. the
+ exact width will be fully available for that column contents).
+
+ Default: _" "_
+
+*column-<name>* = _<go template>_
+ Each name in *index-columns* must have a corresponding *column-<name>*
+ setting. All *column-<name>* settings accept golang text/template
+ syntax.
+
+ By default, these columns are defined:
+
+ ```
+ column-date = {{.DateAutoFormat .Date.Local}}
+ column-name = {{index (.From | names) 0}}
+ column-flags = {{.Flags | join ""}}
+ column-subject = {{.Subject}}
+ ```
+
+ See *aerc-templates*(7) for all available symbols and functions.
*timestamp-format* = _<timeformat>_
See time.Time#Format at https://godoc.org/time#Time.Format