From f76f4ea3f7416a4a641d5891f19927aa354a3247 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 4 Sep 2022 18:28:36 +0300 Subject: [PATCH] docs: add meli.7, a general tutorial document This commit also changes some shortcut names. --- CHANGELOG.md | 9 + docs/meli.1 | 134 ++++---- docs/meli.7 | 314 +++++++++++++++++++ docs/meli.conf.5 | 20 +- docs/samples/sample-config.toml | 5 +- src/components/mail/listing.rs | 9 +- src/components/mail/listing/compact.rs | 10 +- src/components/mail/listing/conversations.rs | 12 +- src/components/mail/listing/plain.rs | 8 +- src/conf/overrides.rs | 4 - src/conf/shortcuts.rs | 22 +- 11 files changed, 428 insertions(+), 119 deletions(-) create mode 100644 docs/meli.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index d3b1d8e57..b0d9d6947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- A new manual page, `meli.7` which contains a general tutorial for using meli. +- Added shortcuts for focusing to sidebar menu and back to the e-mail view (`focus_on_menu` and `focus_on_list`) + +### Changed + +- Shortcut `open_thread` and `exit_thread` renamed to `open_entry` and `exit_entry`. + ## [alpha-0.7.2] - 2021-10-15 ### Added diff --git a/docs/meli.1 b/docs/meli.1 index 9390f26ab..1001260e1 100644 --- a/docs/meli.1 +++ b/docs/meli.1 @@ -17,6 +17,29 @@ .\" You should have received a copy of the GNU General Public License .\" along with meli. If not, see . .\" +.de Shortcut +.Sm +.Aq \\$1 +\ +.Po +.Em shortcuts.\\$2\&. Ns +.Em \\$3 +.Pc +.Sm +.. +.de ShortcutPeriod +.Aq \\$1 +.Po +.Em shortcuts.\\$2\&. Ns +.Em \\$3 +.Pc Ns +.. +.de Command +.Bd -ragged +.Cm \\$* +.Ed +.sp +.. .Dd July 29, 2019 .Dt MELI 1 .Os @@ -43,7 +66,7 @@ if given, or at .It Cm test-config Op Ar path Test a configuration file for syntax issues or missing options. .It Cm man Op Ar page -Print documentation page and exit (Piping to a pager is recommended.) +Print documentation page and exit (Piping to a pager is recommended). .It Cm print-default-theme Print default theme keys and values in TOML syntax, to be used as a blueprint. .It Cm print-loaded-themes @@ -85,14 +108,12 @@ See for the available configuration options. .Pp At any time, you may press -.Cm \&? +.Shortcut \&? general toggle_help for a searchable list of all available actions and shortcuts, along with every possible setting and command that your version supports. .Pp The main visual navigation tool, the left-side sidebar may be toggled with -.Cm ` -(shortcuts.listing: -.Ic toggle_menu_visibility Ns -). +.ShortcutPeriod ` listing toggle_menu_visibility +\&. .Pp Each mailbox may be viewed in 4 modes: Plain views each mail individually, Threaded shows their thread relationship visually, Conversations collapses each thread of emails into a single entry, Compact shows one row per thread. @@ -105,23 +126,22 @@ section of your configuration. See .Xr meli-themes 5 for complete documentation on user themes. +.Pp +See +.Xr meli 7 +for a more detailed tutorial on using +.Nm Ns +\&. .Sh VIEWING MAIL Open attachments by typing their index in the attachments list and then -.Cm a -.Po -shortcut -.Ic open_attachment -.Pc . +.ShortcutPeriod a envelope_view open_attachment +\&. .Nm will attempt to open text inside its pager, and other content via .Cm xdg-open Ns \&. Press -.Cm m -.Po -shortcut -.Ic open_mailcap -.Pc +.Shortcut m envelope_view open_mailcap instead to use the mailcap entry for the MIME type of the attachment, if any. See .Sx FILES @@ -129,12 +149,12 @@ for the location of the mailcap files and .Xr mailcap 5 for their syntax. You can save individual attachments with the -.Em COMMAND -.Cm save-attachment Ar INDEX Ar path-to-file -where +.Command save-attachment Ar INDEX Ar path-to-file +command. .Ar INDEX is the attachment's index in the listing. -If the zeroth index is provided, the entire message is saved. +If the path provided is a directory, the attachment is saved with its filename set to the filename in the attachment, if any. +If the 0th index is provided, the entire message is saved. If the path provided is a directory, the message is saved as an eml file with its filename set to the messages message-id. .Sh SEARCH Each e-mail storage backend has a default search method assigned. @@ -163,9 +183,8 @@ To enable sqlite3 indexing for an account set .Em search_backend to .Em sqlite3 -in the configuration file and to create the sqlite3 index issue command -.Cm index Ar ACCOUNT_NAME Ns \&. -.sp +in the configuration file and to create the sqlite3 index issue command: +.Command index Ar ACCOUNT_NAME Ns To search in the message body type your keywords without any special formatting. To search in specific fields, prepend your search keyword with "field:" like so: .Pp @@ -234,9 +253,9 @@ Sqlite3 on the contrary at reasonable mailbox sizes should have a non noticable .Nm supports tagging in notmuch and IMAP/JMAP backends. Tags can be searched with the `tags:` or `flags:` prefix in a search query, and can be modified by -.Cm tag add TAG +.Command tag add TAG and -.Cm tag remove TAG +.Command tag remove TAG (see .Xr meli.conf 5 TAGS Ns , settings @@ -247,22 +266,17 @@ for how to set tag colors and tag visiblity) .Sh COMPOSING .Ss Opening the message Composer tab To create a new mail message, press -.Cm m -(shortcut -.Ic new_mail Ns -) while viewing a mailbox. +.Shortcut m listing new_mail +while viewing a mailbox. To reply to a mail, press -.Cm R -.Po -shortcut -.Ic reply -.Pc . +.ShortcutPeriod R envelope_view reply +\&. Both these actions open the mail composer view in a new tab. .Ss Editing text .Bl -bullet -compact .It Edit the header fields by selecting with the arrow keys and pressing -.Cm enter +.Shortcut Enter general focus_in_text_field to enter .Em INSERT mode and @@ -270,10 +284,8 @@ mode and key to exit. .It At any time you may press -.Cm e -(shortcut -.Ic edit_mail Ns -) to launch your editor (see +.Shortcut e composing edit_mail Ns +to launch your editor (see .Xr meli.conf 5 COMPOSING Ns , setting .Ic editor_command @@ -285,19 +297,23 @@ Your editor can be used in .Ic embed to .Em true -in your composing settings. +in your composing settings +.Po +You can return to +.Nm +at any time by pressing +.Aq Ctrl-Z +.Pc .It When launched, your editor captures all input until it exits or stops. .It To stop your editor and return to .Nm -press Ctrl-z and to resume editing press the +press +.Aq Ctrl-z +and to resume editing press the .Ic edit_mail -command again -.Po -default -.Em e -.Pc . +command again. .El .Ss Attachments Attachments may be handled with the @@ -307,14 +323,12 @@ Attachments may be handled with the commands (see below). .Ss Sending Finally, pressing -.Cm s -(shortcut -.Ic send_mail Ns -) will send your message according to your settings +.Shortcut s composing send_mail +will send your message according to your settings .Po see .Xr meli.conf 5 COMPOSING Ns -, setting +, setting name .Ic send_mail .Pc Ns \&. @@ -363,9 +377,9 @@ is the default mode commands are issued in .Em COMMAND mode, by default started with -.Cm \&: +.Shortcut \&: general enter_command_mode and exited with -.Cm Esc +.Aq Esc key. .It EMBED is the mode of the embed terminal emulator @@ -585,19 +599,19 @@ Mailcap entries are searched for in the following files, in this order: .Sh SEE ALSO .Xr meli.conf 5 , .Xr meli-themes 5 , +.Xr meli 7 , .Xr xdg-open 1 , .Xr mailcap 5 .Sh CONFORMING TO XDG Standard -.Aq https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Ns +.Lk https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Ns , maildir -.Aq https://cr.yp.to/proto/maildir.html Ns +.Lk https://cr.yp.to/proto/maildir.html Ns , IMAPv4rev1 RFC3501, The JSON Meta Application Protocol (JMAP) RFC8620, The JSON Meta Application Protocol (JMAP) for Mail RFC8621. .Sh AUTHORS -Copyright 2017-2019 -.An Manos Pitsidianakis Aq epilys@nessuent.xyz +Copyright 2017-2022 +.An Manos Pitsidianakis Mt manos@pitsidianak.is Released under the GPL, version 3 or greater. -This software carries no warranty of any kind. -(See COPYING for full copyright and warranty notices.) +This software carries no warranty of any kind (See COPYING for full copyright and warranty notices). .Pp -.Aq https://meli.delivery +.Lk https://meli.delivery diff --git a/docs/meli.7 b/docs/meli.7 new file mode 100644 index 000000000..01a85547b --- /dev/null +++ b/docs/meli.7 @@ -0,0 +1,314 @@ +.\" meli - meli.7 +.\" +.\" Copyright 2017-2022 Manos Pitsidianakis +.\" +.\" This file is part of meli. +.\" +.\" meli is free software: you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" meli is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with meli. If not, see . +.\" +.de Hr +.sp +.Bd -literal -offset center +╌╍─────────────────────────────────────────────────────────╍╌ +.Ed +.sp +.. +.de Shortcut +.Sm +.Aq \\$1 +\ +.Po +.Em shortcuts.\\$2\&. Ns +.Em \\$3 +.Pc +.Sm +.. +.de ShortcutPeriod +.Aq \\$1 +.Po +.Em shortcuts.\\$2\&. Ns +.Em \\$3 +.Pc Ns +.. +.de Command +.Bd -ragged +.Cm \\$* +.Ed +.sp +.. +.Dd September 4, 2022 +.Dt MELI 7 +.Os +.Sh NAME +.Nm meli +.Nd Tutorial for the Meli Mail User Agent +.Sh SYNOPSIS +.Nm +.Op ... +.Sh DESCRIPTION +.Nm +is a terminal mail client aiming for extensive and user-frendly configurability. +.Bd -literal + ^^ .-=-=-=-. ^^ + ^^ (`-=-=-=-=-`) ^^ + (`-=-=-=-=-=-=-`) ^^ ^^ + ^^ (`-=-=-=-=-=-=-=-`) ^^ + ( `-=-=-=-(@)-=-=-` ) ^^ + (`-=-=-=-=-=-=-=-=-`) ^^ + (`-=-=-=-=-=-=-=-=-`) ^^ + (`-=-=-=-=-=-=-=-=-`) +^^ (`-=-=-=-=-=-=-=-=-`) ^^ + ^^ (`-=-=-=-=-=-=-=-`) ^^ + (`-=-=-=-=-=-=-`) ^^ + ^^ (`-=-=-=-=-`) + `-=-=-=-=-` ^^ +.Ed +.Sh STARTING WITH meli +When launched for the first time, +.Nm +will search for its configuration directory, +.Pa $XDG_CONFIG_HOME/meli/ Ns +\&. +If it doesn't exist, you will be asked if you want to create one and presented with a sample configuration file +.Pq Pa $XDG_CONFIG_HOME/meli/config.toml +that includes the basic settings required for setting up accounts allowing you to copy and edit right away. +See +.Xr meli.conf 5 +for the available configuration options. +.Pp +At any time, you may press +.Shortcut \&? general toggle_help +for a searchable list of all available actions and shortcuts, along with every possible setting and command that your version supports. +.Pp +Each time a shortcut is mentioned in this document, you will find a parenthesis next to it with the name of the shortcut setting along with its section in the configuration settings so that you can modify it if you wish. +.Pp +For example, to set the +.Em toggle_help +shortcut mentioned in the previous paragraph, add the following to your configuration: +.Bd -literal -offset center +[shortcuts] +general.toggle_help = 'F1' +.Ed +.sp +Or alternatively: +.Bd -literal -offset center +[shortcuts.general] +toggle_help = 'F1' +.Ed +.Sh INTERACTING WITH Nm +You will be interacting with +.Nm +in four primary ways: +.Bl -column +.It 1. +keyboard shortcuts in +.Sy NORMAL +mode. +.It 2. +commands with arguments in +.Sy COMMAND +mode. +.It 3. +regular text input in text input widgets in +.Sy INSERT +mode. +.It 4. +any kind of input that gets passed directly into an embedded terminal in +.Sy EMBED +mode. +.El +.Ss MODES +.Nm +is a modal application, just like +.Xr vi 1 Ns +\&. +This means that pressing the same keys in different modes would yield different results. +This allows you to separate how the input is interpreted without the need to focus your input with a mouse. +.Bl -tag -width 8n +.It NORMAL +This is the default mode of +.Nm Ns +\&. +All keyboard shortcuts work in this mode. +.It COMMAND +Commands are issued in +.Sy COMMAND +mode, by default started with +.Shortcut \&: general enter_command_mode +and exited with +.Aq Esc +key. +.It EMBED +This is the mode of the embed terminal emulator. +To exit an embedded application, issue +.Aq Ctrl-C +to kill it or +.Aq Ctrl-Z +to stop the program and follow the instructions on +.Nm +to exit. +.It INSERT +This mode is entered when pressing +.Aq Enter +on a cursor selected text input field, and it captures all input as text input. +It is exited with the +.Aq Esc +key. +.El +.Ss MAIN VIEW +.Bd -literal -offset center + ┌───────────────────────┐ + ├────┼──────────────────┤ + │___ │ ___________ │ + │ _ │ _______________ │ + │ _ │__________________│ + │ _ │ ___________ │ + │ │ _____ │ + │ │ │ + └────┴──────────────────┘ +.Ed +.Bd -ragged -offset center +.Sy The main view. +.Ed +.sp +This is the view you will spend more time with in +.Nm Ns +\&. +.Pp +Press +.Shortcut ` listing toggle_menu_visibility +to toggle the sidebars visibility. +.Pp +Press +.Shortcut Left listing focus_on_menu +to switch focus on the sidebar menu. +Press +.Shortcut Right listing focus_on_list +to switch focus on the e-mail list. +.Pp +On the e-mail list, press +.Shortcut k listing scroll_up +to scroll up, and +.Shortcut j listing scroll_down +to scroll down. +Press +.Shortcut Enter listing open_entry +to open an e-mail entry and +.Shortcut i listing exit_entry +to exit it. +.Hr +.Bd -literal -offset center +personal account + 0 INBOX + 1 ┣━Sent + 2 ┣━Lists + 3 ┃ ┣━meli-dev + 4 ┃ ┗━meli + 5 ┣━Drafts + 6 ┣━Trash + 7 ┗━foobar + 8 Trash + 9 Archived +.Ed +.Bd -ragged -offset 3n +.Sy The sidebar\&. +.Ed +.sp +Press +.Shortcut k listing scroll_up +to scroll up, and +.Shortcut j listing scroll_down +to scroll down. +.Pp +Press +.Shortcut Enter listing open_mailbox +to open an entry (either a mailbox or an account name). +Entering an account name will show you a page with details about the account and its network connection, depending on the backend. +.Pp +While focused in the sidebar, you can +.Dq collapse +a mailbox tree, if it has children, and you can +.Dq uncollapse +it with +.ShortcutPeriod Space listing toggle_mailbox_collapse +\&. +You can have mailbox trees collapsed on startup by default by setting a mailbox's +.Ic collapsed +setting to +.Em true Ns +\&. +See +.Xr meli.conf 5 section MAILBOXES +for details. +.Pp +You can increase the sidebar's width with +.Shortcut Ctrl-p listing increase_sidebar +and decrease with +.ShortcutPeriod Ctrl-o listing decrease_sidebar +\&. +.Hr +.Bd -literal +┌────────────────────────────────────────────────────┈┈ +│NORMAL | Mailbox: Inbox, Messages: 25772, New: 3006 +└────────────────────────────────────────────────────┈┈ +.Ed +.Bd -ragged -offset 3n +.Sy The status bar. +.Ed +.Pp +The status bar shows which mode you are, and the status message of the current view. +In the pictured example, it shows the status of a mailbox called +.Dq Inbox +with lots of e-mails. +.Hr +.Bd -literal + ┈┈────────────┐ + 12 │ + ┈┈────────────┘ +.Ed +.Bd -ragged -offset 3n +.Sy The number modifier buffer. +.Ed +.Pp +Some commands may accept a number qualifier. +For example, scroll down commands can receive a multiplier +.Em n +to scroll down +.Em n +entries. +Another use of the number buffer is opening URLs inside the pager. +See +.Sx PAGER +for an explanation of interacting with URLs in e-mails. +.Pp +Pressing numbers in +.Sy NORMAL +mode will populate this buffer. +To erase it, press the +.Aq Esc +key. +.Sh SEE ALSO +.Xr meli 1 , +.Xr meli.conf 5 , +.Xr meli-themes 5 , +.Xr xdg-open 1 , +.Xr mailcap 5 +.Sh AUTHORS +Copyright 2017-2022 +.An Manos Pitsidianakis Mt manos@pitsidianak.is +Released under the GPL, version 3 or greater. +This software carries no warranty of any kind. +(See COPYING for full copyright and warranty notices.) +.Pp +.Lk https://meli.delivery diff --git a/docs/meli.conf.5 b/docs/meli.conf.5 index d29de883b..b8b5eef91 100644 --- a/docs/meli.conf.5 +++ b/docs/meli.conf.5 @@ -635,12 +635,12 @@ next_tab = 'T' .Ed .sp and for -.Em compact-listing Ns +.Em listing Ns : .Bd -literal -[shortcuts.compact-listing] -open_thread = "Enter" -exit_thread = 'i' +[shortcuts.listing] +open_entry = "Enter" +exit_entry = 'i' .Ed .sp .Pp @@ -781,16 +781,12 @@ Decrease sidebar width. Toggle visibility of side menu in mail list. .\" default value .Pq Em ` -.El -.sp -.Em compact-listing -.Bl -tag -width 36n -.It Ic exit_thread -Exit thread view +.It Ic exit_entry +Exit e-mail entry. .\" default value .Pq Em i -.It Ic open_thread -Open thread. +.It Ic open_entry +Open e-mail entry. .\" default value .Pq Em Enter .El diff --git a/docs/samples/sample-config.toml b/docs/samples/sample-config.toml index 82c9747ca..22a4675c6 100644 --- a/docs/samples/sample-config.toml +++ b/docs/samples/sample-config.toml @@ -93,10 +93,6 @@ #[shortcuts.composing] #edit_mail = 'e' # -##Thread view defaults: -#[shortcuts.compact-listing] -#exit_thread = 'i' -# #[shortcuts.contact-list] #create_contact = 'c' #edit_contact = 'e' @@ -111,6 +107,7 @@ #next_account = 'h' #new_mail = 'm' #set_seen = 'n' +#exit_entry = 'i' # ##Pager defaults # diff --git a/src/components/mail/listing.rs b/src/components/mail/listing.rs index 3bdf9113e..b00bfdcbc 100644 --- a/src/components/mail/listing.rs +++ b/src/components/mail/listing.rs @@ -962,7 +962,10 @@ impl Component for Listing { self.set_dirty(true); return true; } - UIEvent::Input(Key::Left) if self.menu_visibility => { + UIEvent::Input(ref k) + if self.menu_visibility + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["focus_on_menu"]) => + { self.focus = ListingFocus::Menu; if self.show_menu_scrollbar != ShowMenuScrollbar::Never { self.menu_scrollbar_show_timer.rearm(); @@ -1333,7 +1336,9 @@ impl Component for Listing { } } else if self.focus == ListingFocus::Menu { match *event { - UIEvent::Input(Key::Right) => { + UIEvent::Input(ref k) + if shortcut!(k == shortcuts[Listing::DESCRIPTION]["focus_on_list"]) => + { self.focus = ListingFocus::Mailbox; context .replies diff --git a/src/components/mail/listing/compact.rs b/src/components/mail/listing/compact.rs index b29807271..fd09a080f 100644 --- a/src/components/mail/listing/compact.rs +++ b/src/components/mail/listing/compact.rs @@ -1725,9 +1725,7 @@ impl Component for CompactListing { match *event { UIEvent::Input(ref k) if !self.unfocused - && shortcut!( - k == shortcuts[CompactListing::DESCRIPTION]["open_thread"] - ) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["open_entry"]) => { let thread = self.get_thread_under_cursor(self.cursor_pos.2); self.view = ThreadView::new(self.cursor_pos, thread, None, context); @@ -1737,9 +1735,7 @@ impl Component for CompactListing { } UIEvent::Input(ref k) if self.unfocused - && shortcut!( - k == shortcuts[CompactListing::DESCRIPTION]["exit_thread"] - ) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["exit_entry"]) => { self.unfocused = false; self.view @@ -2043,8 +2039,6 @@ impl Component for CompactListing { ShortcutMaps::default() }; - let config_map = context.settings.shortcuts.compact_listing.key_values(); - map.insert(CompactListing::DESCRIPTION, config_map); let config_map = context.settings.shortcuts.listing.key_values(); map.insert(Listing::DESCRIPTION, config_map); diff --git a/src/components/mail/listing/conversations.rs b/src/components/mail/listing/conversations.rs index 51ce76e84..95c56c4e4 100644 --- a/src/components/mail/listing/conversations.rs +++ b/src/components/mail/listing/conversations.rs @@ -565,7 +565,7 @@ impl fmt::Display for ConversationsListing { } impl ConversationsListing { - const DESCRIPTION: &'static str = "conversations listing"; + //const DESCRIPTION: &'static str = "conversations listing"; //const PADDING_CHAR: char = ' '; //░'; pub fn new(coordinates: (AccountHash, MailboxHash)) -> Box { @@ -1167,9 +1167,7 @@ impl Component for ConversationsListing { match *event { UIEvent::Input(ref k) if !self.unfocused - && shortcut!( - k == shortcuts[ConversationsListing::DESCRIPTION]["open_thread"] - ) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["open_entry"]) => { let thread = self.get_thread_under_cursor(self.cursor_pos.2); self.view = ThreadView::new(self.cursor_pos, thread, None, context); @@ -1179,9 +1177,7 @@ impl Component for ConversationsListing { } UIEvent::Input(ref k) if self.unfocused - && shortcut!( - k == shortcuts[ConversationsListing::DESCRIPTION]["exit_thread"] - ) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["exit_entry"]) => { self.unfocused = false; self.view @@ -1458,8 +1454,6 @@ impl Component for ConversationsListing { ShortcutMaps::default() }; - let config_map = context.settings.shortcuts.compact_listing.key_values(); - map.insert(ConversationsListing::DESCRIPTION, config_map); let config_map = context.settings.shortcuts.listing.key_values(); map.insert(Listing::DESCRIPTION, config_map); diff --git a/src/components/mail/listing/plain.rs b/src/components/mail/listing/plain.rs index 84a41f381..0228fa649 100644 --- a/src/components/mail/listing/plain.rs +++ b/src/components/mail/listing/plain.rs @@ -657,7 +657,7 @@ impl fmt::Display for PlainListing { } impl PlainListing { - const DESCRIPTION: &'static str = "plain listing"; + //const DESCRIPTION: &'static str = "plain listing"; pub fn new(coordinates: (AccountHash, MailboxHash)) -> Box { Box::new(PlainListing { cursor_pos: (0, 1, 0), @@ -1139,7 +1139,7 @@ impl Component for PlainListing { match *event { UIEvent::Input(ref k) if !self.unfocused - && shortcut!(k == shortcuts[PlainListing::DESCRIPTION]["open_thread"]) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["open_entry"]) => { let env_hash = self.get_env_under_cursor(self.cursor_pos.2, context); let temp = (self.cursor_pos.0, self.cursor_pos.1, env_hash); @@ -1150,7 +1150,7 @@ impl Component for PlainListing { } UIEvent::Input(ref k) if self.unfocused - && shortcut!(k == shortcuts[PlainListing::DESCRIPTION]["exit_thread"]) => + && shortcut!(k == shortcuts[Listing::DESCRIPTION]["exit_entry"]) => { self.unfocused = false; self.view @@ -1411,8 +1411,6 @@ impl Component for PlainListing { ShortcutMaps::default() }; - let config_map = context.settings.shortcuts.compact_listing.key_values(); - map.insert(PlainListing::DESCRIPTION, config_map); let config_map = context.settings.shortcuts.listing.key_values(); map.insert(Listing::DESCRIPTION, config_map); diff --git a/src/conf/overrides.rs b/src/conf/overrides.rs index 9ded27dc6..abc375b6a 100644 --- a/src/conf/overrides.rs +++ b/src/conf/overrides.rs @@ -240,9 +240,6 @@ pub struct ShortcutsOverride { pub listing: Option, #[serde(default)] pub composing: Option, - #[serde(alias = "compact-listing")] - #[serde(default)] - pub compact_listing: Option, #[serde(alias = "contact-list")] #[serde(default)] pub contact_list: Option, @@ -261,7 +258,6 @@ impl Default for ShortcutsOverride { general: None, listing: None, composing: None, - compact_listing: None, contact_list: None, envelope_view: None, thread_view: None, diff --git a/src/conf/shortcuts.rs b/src/conf/shortcuts.rs index 50875b3f3..63e634201 100644 --- a/src/conf/shortcuts.rs +++ b/src/conf/shortcuts.rs @@ -43,8 +43,6 @@ pub struct Shortcuts { pub listing: ListingShortcuts, #[serde(default)] pub composing: ComposingShortcuts, - #[serde(default, alias = "compact-listing")] - pub compact_listing: CompactListingShortcuts, #[serde(default, alias = "contact-list")] pub contact_list: ContactListShortcuts, #[serde(default, alias = "envelope-view")] @@ -64,9 +62,6 @@ impl DotAddressable for Shortcuts { "general" => self.general.lookup(field, tail), "listing" => self.listing.lookup(field, tail), "composing" => self.composing.lookup(field, tail), - "compact_listing" | "compact-listing" => { - self.compact_listing.lookup(field, tail) - } "contact_list" | "contact-list" => self.contact_list.lookup(field, tail), "envelope_view" | "envelope-view" => self.envelope_view.lookup(field, tail), "thread_view" | "thread-view" => self.thread_view.lookup(field, tail), @@ -141,14 +136,6 @@ macro_rules! shortcut_key_values { } } -shortcut_key_values! { "compact-listing", - /// Shortcut listing for a mail listing in compact mode. - pub struct CompactListingShortcuts { - exit_thread |> "Exit thread view." |> Key::Char('i'), - open_thread |> "Open thread." |> Key::Char('\n') - } -} - shortcut_key_values! { "listing", /// Shortcut listing for a mail listing. pub struct ListingShortcuts { @@ -172,7 +159,11 @@ shortcut_key_values! { "listing", select_entry |> "Select thread entry." |> Key::Char('v'), increase_sidebar |> "Increase sidebar width." |> Key::Ctrl('p'), decrease_sidebar |> "Decrease sidebar width." |> Key::Ctrl('o'), - toggle_menu_visibility |> "Toggle visibility of side menu in mail list." |> Key::Char('`') + toggle_menu_visibility |> "Toggle visibility of side menu in mail list." |> Key::Char('`'), + focus_on_menu |> "Switch focus on sidebar menu." |> Key::Left, + focus_on_list |> "Switch focus on mail list." |> Key::Right, + exit_entry |> "Exit e-mail entry." |> Key::Char('i'), + open_entry |> "Open e-mail entry." |> Key::Char('\n') } } @@ -212,7 +203,8 @@ shortcut_key_values! { "general", scroll_up |> "Generic scroll up (catch-all setting)" |> Key::Char('k'), scroll_down |> "Generic scroll down (catch-all setting)" |> Key::Char('j'), info_message_next |> "Show next info message, if any" |> Key::Alt('>'), - info_message_previous |> "Show previous info message, if any" |> Key::Alt('<') + info_message_previous |> "Show previous info message, if any" |> Key::Alt('<'), + focus_in_text_field |> "Focus on a text field." |> Key::Char('\n') } }