NeoMutt  2025-09-05-55-g97fc89
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
init.c File Reference

Set up the key bindings. More...

#include "config.h"
#include <string.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "menu/lib.h"
+ Include dependency graph for init.c:

Go to the source code of this file.

Functions

static void create_bindings (const struct MenuOpSeq *map, enum MenuType mtype)
 Attach a set of keybindings to a Menu.
 
void km_init (void)
 Initialise all the menu keybindings.
 
static void mutt_keymaplist_free (struct KeymapList *km_list)
 Free a List of Keymaps.
 
int key_config_observer (struct NotifyCallback *nc)
 Notification that a Config Variable has changed - Implements observer_t -.
 
void mutt_keys_cleanup (void)
 Free the key maps.
 
void mutt_init_abort_key (void)
 Parse the abort_key config string.
 

Variables

const struct MenuOpSeq AliasDefaultBindings []
 Key bindings for the Alias Menu.
 
const struct MenuOpSeq AttachmentDefaultBindings []
 Key bindings for the Attachment Menu.
 
const struct MenuOpSeq AutocryptDefaultBindings []
 Key bindings for the Autocrypt Account.
 
const struct MenuOpSeq BrowserDefaultBindings []
 Key bindings for the file Browser Menu.
 
const struct MenuOpSeq ComposeDefaultBindings []
 Key bindings for the Compose Menu.
 
const struct MenuOpSeq EditorDefaultBindings []
 Key bindings for the Editor Menu.
 
const struct MenuOpSeq IndexDefaultBindings []
 Key bindings for the Index Menu.
 
const struct MenuOpSeq PagerDefaultBindings []
 Key bindings for the Pager Menu.
 
const struct MenuOpSeq PgpDefaultBindings []
 Key bindings for the Pgp Menu.
 
const struct MenuOpSeq PostponedDefaultBindings []
 Key bindings for the Postpone Menu.
 
const struct MenuOpSeq QueryDefaultBindings []
 Key bindings for the external Query Menu.
 
const struct MenuOpSeq SmimeDefaultBindings []
 Key bindings for the Smime Menu.
 
static const struct Command KeyCommands []
 Key Binding Commands.
 

Detailed Description

Set up the key bindings.

Authors
  • Richard Russon

This program 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 this program. If not, see http://www.gnu.org/licenses/.

Definition in file init.c.

Function Documentation

◆ create_bindings()

static void create_bindings ( const struct MenuOpSeq * map,
enum MenuType mtype )
static

Attach a set of keybindings to a Menu.

Parameters
mapKey bindings
mtypeMenu type, e.g. MENU_PAGER

Definition at line 58 of file init.c.

59{
60 STAILQ_INIT(&Keymaps[mtype]);
61
62 for (int i = 0; map[i].op != OP_NULL; i++)
63 if (map[i].seq)
64 km_bind(map[i].seq, mtype, map[i].op, NULL, NULL, NULL);
65}
enum CommandResult km_bind(const char *s, enum MenuType mtype, int op, char *macro, char *desc, struct Buffer *err)
Set up a key binding.
Definition commands.c:58
struct KeymapList Keymaps[MENU_MAX]
Array of key mappings, one for each MenuType.
Definition lib.c:125
#define STAILQ_INIT(head)
Definition queue.h:410
int op
Operation, e.g. OP_DELETE.
Definition lib.h:126
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ km_init()

void km_init ( void )

Initialise all the menu keybindings.

Definition at line 85 of file init.c.

86{
87 memset(Keymaps, 0, sizeof(struct KeymapList) * MENU_MAX);
88
91#ifdef USE_AUTOCRYPT
93#endif
105
107}
const struct MenuOpSeq QueryDefaultBindings[]
Key bindings for the external Query Menu.
Definition functions.c:109
const struct MenuOpSeq AliasDefaultBindings[]
Key bindings for the Alias Menu.
Definition functions.c:92
const struct MenuOpSeq AttachmentDefaultBindings[]
Key bindings for the Attachment Menu.
Definition functions.c:98
const struct MenuOpSeq AutocryptDefaultBindings[]
Key bindings for the Autocrypt Account.
Definition functions.c:68
const struct MenuOpSeq BrowserDefaultBindings[]
Key bindings for the file Browser Menu.
Definition functions.c:106
const struct MenuOpSeq ComposeDefaultBindings[]
Key bindings for the Compose Menu.
Definition functions.c:155
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
const struct MenuOpSeq EditorDefaultBindings[]
Key bindings for the Editor Menu.
Definition functions.c:88
const struct MenuOpSeq GenericDefaultBindings[]
Key bindings for the Generic Menu.
Definition functions.c:139
const struct MenuOpSeq DialogDefaultBindings[]
Key bindings for Simple Dialogs.
Definition functions.c:131
const struct MenuOpSeq IndexDefaultBindings[]
Key bindings for the Index Menu.
Definition functions.c:235
const struct MenuOpSeq PostponedDefaultBindings[]
Key bindings for the Postpone Menu.
Definition functions.c:62
const struct MenuOpSeq PagerDefaultBindings[]
Key bindings for the Pager Menu.
Definition functions.c:228
static const struct Command KeyCommands[]
Key Binding Commands.
Definition init.c:70
static void create_bindings(const struct MenuOpSeq *map, enum MenuType mtype)
Attach a set of keybindings to a Menu.
Definition init.c:58
const struct MenuOpSeq PgpDefaultBindings[]
Key bindings for the Pgp Menu.
Definition functions.c:64
const struct MenuOpSeq SmimeDefaultBindings[]
Key bindings for the Smime Menu.
Definition functions.c:74
Container for Accounts, Notifications.
Definition neomutt.h:43
struct CommandArray commands
NeoMutt commands.
Definition neomutt.h:51
@ MENU_INDEX
Index panel (list of emails)
Definition type.h:46
@ MENU_DIALOG
Simple Dialog.
Definition type.h:43
@ MENU_QUERY
Select from results of external query.
Definition type.h:50
@ MENU_BROWSER
General file/mailbox browser.
Definition type.h:41
@ MENU_AUTOCRYPT
Autocrypt Account menu.
Definition type.h:39
@ MENU_COMPOSE
Compose an email.
Definition type.h:42
@ MENU_ATTACHMENT
Select an attachment.
Definition type.h:37
@ MENU_PGP
PGP encryption menu.
Definition type.h:48
@ MENU_GENERIC
Generic selection list.
Definition type.h:45
@ MENU_PAGER
Pager pager (email viewer)
Definition type.h:47
@ MENU_SMIME
SMIME encryption menu.
Definition type.h:51
@ MENU_MAX
Definition type.h:52
@ MENU_EDITOR
Text entry area.
Definition type.h:44
@ MENU_ALIAS
Select an email address by its alias.
Definition type.h:36
@ MENU_POSTPONED
Select a postponed email.
Definition type.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_keymaplist_free()

static void mutt_keymaplist_free ( struct KeymapList * km_list)
static

Free a List of Keymaps.

Parameters
km_listList of Keymaps to free

Definition at line 113 of file init.c.

114{
115 struct Keymap *np = NULL, *tmp = NULL;
116 STAILQ_FOREACH_SAFE(np, km_list, entries, tmp)
117 {
118 STAILQ_REMOVE(km_list, np, Keymap, entries);
119 mutt_keymap_free(&np);
120 }
121}
void mutt_keymap_free(struct Keymap **ptr)
Free a Keymap.
Definition lib.c:131
#define STAILQ_REMOVE(head, elm, type, field)
Definition queue.h:441
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition queue.h:400
A keyboard mapping.
Definition lib.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_keys_cleanup()

void mutt_keys_cleanup ( void )

Free the key maps.

Definition at line 146 of file init.c.

147{
148 for (enum MenuType i = 1; i < MENU_MAX; i++)
149 {
151 }
152
153 if (NeoMutt && NeoMutt->sub)
155}
int key_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition init.c:126
static void mutt_keymaplist_free(struct KeymapList *km_list)
Free a List of Keymaps.
Definition init.c:113
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition subset.h:51
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:47
MenuType
Types of GUI selections.
Definition type.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_init_abort_key()

void mutt_init_abort_key ( void )

Parse the abort_key config string.

Parse the string into $abort_key and put the keycode into AbortKey.

Definition at line 162 of file init.c.

163{
164 keycode_t buf[2];
165 const char *const c_abort_key = cs_subset_string(NeoMutt->sub, "abort_key");
166 size_t len = parsekeys(c_abort_key, buf, countof(buf));
167 if (len == 0)
168 {
169 mutt_error(_("Abort key is not set, defaulting to Ctrl-G"));
170 AbortKey = ctrl('G');
171 return;
172 }
173 if (len > 1)
174 {
175 mutt_warning(_("Specified abort key sequence (%s) will be truncated to first key"),
176 c_abort_key);
177 }
178 AbortKey = buf[0];
179
181}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
#define mutt_warning(...)
Definition logging2.h:91
#define mutt_error(...)
Definition logging2.h:93
keycode_t AbortKey
code of key to abort prompts, normally Ctrl-G
Definition lib.c:122
size_t parsekeys(const char *str, keycode_t *d, size_t max)
Parse a key string into key codes.
Definition lib.c:216
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
Definition lib.h:57
#define countof(x)
Definition memory.h:44
#define _(a)
Definition message.h:28
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition notify.c:191
#define ctrl(ch)
Definition mutt_curses.h:52
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition notify_type.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ AliasDefaultBindings

const struct MenuOpSeq AliasDefaultBindings[]
extern

Key bindings for the Alias Menu.

Definition at line 92 of file functions.c.

92 { /* map: alias */
93 { OP_DELETE, "d" },
94 { OP_EXIT, "q" },
95 { OP_MAIL, "m" },
96 { OP_MAIN_LIMIT, "l" },
97 { OP_MAIN_TAG_PATTERN, "T" },
98 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
99 { OP_SORT, "o" },
100 { OP_SORT_REVERSE, "O" },
101 { OP_TAG, "<space>" },
102 { OP_UNDELETE, "u" },
103 { 0, NULL },
104};

◆ AttachmentDefaultBindings

const struct MenuOpSeq AttachmentDefaultBindings[]
extern

Key bindings for the Attachment Menu.

Definition at line 98 of file functions.c.

98 { /* map: attachment */
99 { OP_ATTACHMENT_COLLAPSE, "v" },
100 { OP_ATTACHMENT_DELETE, "d" },
101 { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E>
102 { OP_EXIT, "q" },
103 { OP_PIPE, "|" },
104 { OP_ATTACHMENT_PRINT, "p" },
105 { OP_ATTACHMENT_SAVE, "s" },
106 { OP_ATTACHMENT_UNDELETE, "u" },
107 { OP_ATTACHMENT_VIEW, "<keypadenter>" },
108 { OP_ATTACHMENT_VIEW, "\n" }, // <Enter>
109 { OP_ATTACHMENT_VIEW, "\r" }, // <Return>
110 { OP_ATTACHMENT_VIEW_MAILCAP, "m" },
111 { OP_ATTACHMENT_VIEW_TEXT, "T" },
112 { OP_BOUNCE_MESSAGE, "b" },
113 { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P>
114 { OP_DISPLAY_HEADERS, "h" },
115 { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K>
116 { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F>
117 { OP_FORWARD_MESSAGE, "f" },
118 { OP_GROUP_REPLY, "g" },
119 { OP_LIST_REPLY, "L" },
120 { OP_REPLY, "r" },
121 { OP_RESEND, "\033e" }, // <Alt-e>
122 { 0, NULL },
123};

◆ AutocryptDefaultBindings

const struct MenuOpSeq AutocryptDefaultBindings[]
extern

Key bindings for the Autocrypt Account.

Definition at line 68 of file functions.c.

68 { /* map: autocrypt account */
69 { OP_AUTOCRYPT_CREATE_ACCT, "c" },
70 { OP_AUTOCRYPT_DELETE_ACCT, "D" },
71 { OP_AUTOCRYPT_TOGGLE_ACTIVE, "a" },
72 { OP_AUTOCRYPT_TOGGLE_PREFER, "p" },
73 { OP_EXIT, "q" },
74 { 0, NULL }
75};

◆ BrowserDefaultBindings

const struct MenuOpSeq BrowserDefaultBindings[]
extern

Key bindings for the file Browser Menu.

Definition at line 106 of file functions.c.

106 { /* map: browser */
107 { OP_BROWSER_GOTO_FOLDER, "=" },
108 { OP_BROWSER_NEW_FILE, "N" },
109 { OP_BROWSER_SUBSCRIBE, "s" },
110 { OP_BROWSER_TELL, "@" },
111 { OP_BROWSER_TOGGLE_LSUB, "T" },
112 { OP_BROWSER_UNSUBSCRIBE, "u" },
113 { OP_BROWSER_VIEW_FILE, " " }, // <Space>
114 { OP_CHANGE_DIRECTORY, "c" },
115 { OP_CREATE_MAILBOX, "C" },
116 { OP_DELETE_MAILBOX, "d" },
117 { OP_ENTER_MASK, "m" },
118 { OP_EXIT, "q" },
119 { OP_GOTO_PARENT, "p" },
120 { OP_MAILBOX_LIST, "." },
121 { OP_RENAME_MAILBOX, "r" },
122 { OP_SORT, "o" },
123 { OP_SORT_REVERSE, "O" },
124 { OP_TOGGLE_MAILBOXES, "\t" }, // <Tab>
125 { 0, NULL },
126};

◆ ComposeDefaultBindings

const struct MenuOpSeq ComposeDefaultBindings[]
extern

Key bindings for the Compose Menu.

Definition at line 155 of file functions.c.

155 { /* map: compose */
156 { OP_ATTACHMENT_ATTACH_FILE, "a" },
157 { OP_ATTACHMENT_ATTACH_KEY, "\033k" }, // <Alt-k>
158 { OP_ATTACHMENT_ATTACH_MESSAGE, "A" },
159 { OP_ATTACHMENT_DETACH, "D" },
160 { OP_ATTACHMENT_EDIT_CONTENT_ID, "\033i" }, // <Alt-i>
161 { OP_ATTACHMENT_EDIT_DESCRIPTION, "d" },
162 { OP_ATTACHMENT_EDIT_ENCODING, "\005" }, // <Ctrl-E>
163 { OP_ATTACHMENT_EDIT_LANGUAGE, "\014" }, // <Ctrl-L>
164 { OP_ATTACHMENT_EDIT_MIME, "m" },
165 { OP_ATTACHMENT_EDIT_TYPE, "\024" }, // <Ctrl-T>
166 { OP_ATTACHMENT_FILTER, "F" },
167 { OP_ATTACHMENT_GET_ATTACHMENT, "G" },
168 { OP_ATTACHMENT_GROUP_ALTS, "&" },
169 { OP_ATTACHMENT_GROUP_LINGUAL, "^" },
170 { OP_ATTACHMENT_GROUP_RELATED, "%" },
171 { OP_ATTACHMENT_MOVE_DOWN, "+" },
172 { OP_ATTACHMENT_MOVE_UP, "-" },
173 { OP_ATTACHMENT_NEW_MIME, "n" },
174 { OP_EXIT, "q" },
175 { OP_PIPE, "|" },
176 { OP_ATTACHMENT_PRINT, "l" },
177 { OP_ATTACHMENT_RENAME_ATTACHMENT, "\017" }, // <Ctrl-O>
178 { OP_ATTACHMENT_SAVE, "C" },
179 { OP_ATTACHMENT_TOGGLE_DISPOSITION, "\004" }, // <Ctrl-D>
180 { OP_ATTACHMENT_TOGGLE_UNLINK, "u" },
181 { OP_ATTACHMENT_UNGROUP, "#" },
182 { OP_ATTACHMENT_UPDATE_ENCODING, "U" },
183 { OP_ATTACHMENT_VIEW, "<keypadenter>" },
184 { OP_ATTACHMENT_VIEW, "\n" }, // <Enter>
185 { OP_ATTACHMENT_VIEW, "\r" }, // <Return>
186#ifdef USE_AUTOCRYPT
187 { OP_COMPOSE_AUTOCRYPT_MENU, "o" },
188#endif
189 { OP_COMPOSE_EDIT_FILE, "\033e" }, // <Alt-e>
190 { OP_COMPOSE_EDIT_MESSAGE, "e" },
191 { OP_COMPOSE_ISPELL, "i" },
192 { OP_COMPOSE_PGP_MENU, "p" },
193 { OP_COMPOSE_POSTPONE_MESSAGE, "P" },
194 { OP_COMPOSE_RENAME_FILE, "R" },
195 { OP_COMPOSE_SEND_MESSAGE, "y" },
196 { OP_COMPOSE_SMIME_MENU, "S" },
197 { OP_COMPOSE_WRITE_MESSAGE, "w" },
198 { OP_DISPLAY_HEADERS, "h" },
199 { OP_ENVELOPE_EDIT_BCC, "b" },
200 { OP_ENVELOPE_EDIT_CC, "c" },
201 { OP_ENVELOPE_EDIT_FCC, "f" },
202 { OP_ENVELOPE_EDIT_FROM, "\033f" }, // <Alt-f>
203 { OP_ENVELOPE_EDIT_HEADERS, "E" },
204 { OP_ENVELOPE_EDIT_REPLY_TO, "r" },
205 { OP_ENVELOPE_EDIT_SUBJECT, "s" },
206 { OP_ENVELOPE_EDIT_TO, "t" },
207 { OP_PREVIEW_PAGE_DOWN, "<pagedown>" },
208 { OP_PREVIEW_PAGE_UP, "<pageup>" },
209 { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F>
210 { OP_TAG, "T" },
211 { 0, NULL },
212};

◆ EditorDefaultBindings

const struct MenuOpSeq EditorDefaultBindings[]
extern

Key bindings for the Editor Menu.

Definition at line 88 of file functions.c.

88 { /* map: editor */
89 { OP_EDITOR_BACKSPACE, "<backspace>" },
90 { OP_EDITOR_BACKSPACE, "\010" }, // <Ctrl-H>
91 { OP_EDITOR_BACKSPACE, "\177" }, // <Backspace>
92 { OP_EDITOR_BACKWARD_CHAR, "<left>" },
93 { OP_EDITOR_BACKWARD_CHAR, "\002" }, // <Ctrl-B>
94 { OP_EDITOR_BACKWARD_WORD, "\033b" }, // <Alt-b>
95 { OP_EDITOR_BOL, "<home>" },
96 { OP_EDITOR_BOL, "\001" }, // <Ctrl-A>
97 { OP_EDITOR_CAPITALIZE_WORD, "\033c" }, // <Alt-c>
98 { OP_EDITOR_COMPLETE, "\t" }, // <Tab>
99 { OP_EDITOR_COMPLETE_QUERY, "\024" }, // <Ctrl-T>
100 { OP_EDITOR_DELETE_CHAR, "<delete>" },
101 { OP_EDITOR_DELETE_CHAR, "\004" }, // <Ctrl-D>
102 { OP_EDITOR_DOWNCASE_WORD, "\033l" }, // <Alt-l>
103 { OP_EDITOR_EOL, "<end>" },
104 { OP_EDITOR_EOL, "\005" }, // <Ctrl-E>
105 { OP_EDITOR_FORWARD_CHAR, "<right>" },
106 { OP_EDITOR_FORWARD_CHAR, "\006" }, // <Ctrl-F>
107 { OP_EDITOR_FORWARD_WORD, "\033f" }, // <Alt-f>
108 { OP_EDITOR_HISTORY_DOWN, "<down>" },
109 { OP_EDITOR_HISTORY_DOWN, "\016" }, // <Ctrl-N>
110 { OP_EDITOR_HISTORY_SEARCH, "\022" }, // <Ctrl-R>
111 { OP_EDITOR_HISTORY_UP, "<up>" },
112 { OP_EDITOR_HISTORY_UP, "\020" }, // <Ctrl-P>
113 { OP_EDITOR_KILL_EOL, "\013" }, // <Ctrl-K>
114 { OP_EDITOR_KILL_EOW, "\033d" }, // <Alt-d>
115 { OP_EDITOR_KILL_LINE, "\025" }, // <Ctrl-U>
116 { OP_EDITOR_KILL_WORD, "\027" }, // <Ctrl-W>
117 { OP_EDITOR_MAILBOX_CYCLE, " " }, // <Space>
118 { OP_EDITOR_QUOTE_CHAR, "\026" }, // <Ctrl-V>
119 { OP_EDITOR_UPCASE_WORD, "\033u" }, // <Alt-u>
120 { OP_HELP, "\033?" }, // <Alt-?>
121 { OP_REDRAW, "\014" }, // <Ctrl-L>
122 { 0, NULL },
123};

◆ IndexDefaultBindings

const struct MenuOpSeq IndexDefaultBindings[]
extern

Key bindings for the Index Menu.

Definition at line 235 of file functions.c.

235 { /* map: index */
236 { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E>
237#ifdef USE_AUTOCRYPT
238 { OP_AUTOCRYPT_ACCT_MENU, "A" },
239#endif
240 { OP_BOUNCE_MESSAGE, "b" },
241 { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P>
242 { OP_COPY_MESSAGE, "C" },
243 { OP_CREATE_ALIAS, "a" },
244 { OP_DECODE_COPY, "\033C" }, // <Alt-C>
245 { OP_DECODE_SAVE, "\033s" }, // <Alt-s>
246 { OP_DELETE, "d" },
247 { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d>
248 { OP_DELETE_THREAD, "\004" }, // <Ctrl-D>
249 { OP_DISPLAY_ADDRESS, "@" },
250 { OP_DISPLAY_HEADERS, "h" },
251 { OP_DISPLAY_MESSAGE, " " }, // <Space>
252 { OP_DISPLAY_MESSAGE, "<keypadenter>" },
253 { OP_DISPLAY_MESSAGE, "\n" }, // <Enter>
254 { OP_DISPLAY_MESSAGE, "\r" }, // <Return>
255 { OP_EDIT_LABEL, "Y" },
256 { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" },
257 { OP_EXIT, "x" },
258 { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K>
259 { OP_FLAG_MESSAGE, "F" },
260 { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F>
261 { OP_FORWARD_MESSAGE, "f" },
262 { OP_GROUP_REPLY, "g" },
263 { OP_LIST_REPLY, "L" },
264 { OP_MAIL, "m" },
265 { OP_MAILBOX_LIST, "." },
266 { OP_MAIL_KEY, "\033k" }, // <Alt-k>
267 { OP_MAIN_BREAK_THREAD, "#" },
268 { OP_MAIN_CHANGE_FOLDER, "c" },
269 { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c>
270 { OP_MAIN_CHANGE_GROUP, "i" },
271 { OP_MAIN_CHANGE_GROUP_READONLY, "\033i" }, // <Alt-i>
272 { OP_MAIN_CLEAR_FLAG, "W" },
273 { OP_MAIN_COLLAPSE_ALL, "\033V" }, // <Alt-V>
274 { OP_MAIN_COLLAPSE_THREAD, "\033v" }, // <Alt-v>
275 { OP_MAIN_DELETE_PATTERN, "D" },
276 { OP_MAIN_FETCH_MAIL, "G" },
277 { OP_MAIN_LIMIT, "l" },
278 { OP_MAIN_LINK_THREADS, "&" },
279 { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab>
280 { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n>
281 { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N>
282 { OP_MAIN_NEXT_UNDELETED, "<down>" },
283 { OP_MAIN_NEXT_UNDELETED, "j" },
284 { OP_MAIN_PARENT_MESSAGE, "P" },
285 { OP_MAIN_PREV_NEW_THEN_UNREAD, "\033\t" }, // <Alt->
286 { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p>
287 { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P>
288 { OP_MAIN_PREV_UNDELETED, "<up>" },
289 { OP_MAIN_PREV_UNDELETED, "k" },
290 { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r>
291 { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R>
292 { OP_MAIN_SET_FLAG, "w" },
293 { OP_MAIN_SHOW_LIMIT, "\033l" }, // <Alt-l>
294 { OP_MAIN_SYNC_FOLDER, "$" },
295 { OP_MAIN_TAG_PATTERN, "T" },
296 { OP_MAIN_UNDELETE_PATTERN, "U" },
297 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
298 { OP_MARK_MSG, "~" },
299 { OP_NEXT_ENTRY, "J" },
300 { OP_PIPE, "|" },
301 { OP_PREV_ENTRY, "K" },
302 { OP_PRINT, "p" },
303 { OP_QUERY, "Q" },
304 { OP_QUIT, "q" },
305 { OP_RECALL_MESSAGE, "R" },
306 { OP_REPLY, "r" },
307 { OP_RESEND, "\033e" }, // <Alt-e>
308 { OP_SAVE, "s" },
309 { OP_SHOW_LOG_MESSAGES, "M" },
310 { OP_SORT, "o" },
311 { OP_SORT_REVERSE, "O" },
312 { OP_TAG_THREAD, "\033t" }, // <Alt-t>
313 { OP_TOGGLE_NEW, "N" },
314 { OP_TOGGLE_WRITE, "%" },
315 { OP_UNDELETE, "u" },
316 { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u>
317 { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U>
318 { OP_VIEW_ATTACHMENTS, "v" },
319 { 0, NULL },
320};

◆ PagerDefaultBindings

const struct MenuOpSeq PagerDefaultBindings[]
extern

Key bindings for the Pager Menu.

Definition at line 228 of file functions.c.

228 { /* map: pager */
229 { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E>
230 { OP_BOUNCE_MESSAGE, "b" },
231 { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P>
232 { OP_COPY_MESSAGE, "C" },
233 { OP_CREATE_ALIAS, "a" },
234 { OP_DECODE_COPY, "\033C" }, // <Alt-C>
235 { OP_DECODE_SAVE, "\033s" }, // <Alt-s>
236 { OP_DELETE, "d" },
237 { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d>
238 { OP_DELETE_THREAD, "\004" }, // <Ctrl-D>
239 { OP_DISPLAY_ADDRESS, "@" },
240 { OP_DISPLAY_HEADERS, "h" },
241 { OP_EDIT_LABEL, "Y" },
242 { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" },
243 { OP_ENTER_COMMAND, ":" },
244 { OP_EXIT, "i" },
245 { OP_EXIT, "q" },
246 { OP_EXIT, "x" },
247 { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K>
248 { OP_FLAG_MESSAGE, "F" },
249 { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F>
250 { OP_FORWARD_MESSAGE, "f" },
251 { OP_GROUP_REPLY, "g" },
252 { OP_HELP, "?" },
253 { OP_JUMP_1, "1" },
254 { OP_JUMP_2, "2" },
255 { OP_JUMP_3, "3" },
256 { OP_JUMP_4, "4" },
257 { OP_JUMP_5, "5" },
258 { OP_JUMP_6, "6" },
259 { OP_JUMP_7, "7" },
260 { OP_JUMP_8, "8" },
261 { OP_JUMP_9, "9" },
262 { OP_LIST_REPLY, "L" },
263 { OP_MAIL, "m" },
264 { OP_MAILBOX_LIST, "." },
265 { OP_MAIL_KEY, "\033k" }, // <Alt-k>
266 { OP_MAIN_BREAK_THREAD, "#" },
267 { OP_MAIN_CHANGE_FOLDER, "c" },
268 { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c>
269 { OP_MAIN_CLEAR_FLAG, "W" },
270 { OP_MAIN_LINK_THREADS, "&" },
271 { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab>
272 { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n>
273 { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N>
274 { OP_MAIN_NEXT_UNDELETED, "<down>" },
275 { OP_MAIN_NEXT_UNDELETED, "<right>" },
276 { OP_MAIN_NEXT_UNDELETED, "j" },
277 { OP_MAIN_PARENT_MESSAGE, "P" },
278 { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p>
279 { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P>
280 { OP_MAIN_PREV_UNDELETED, "<left>" },
281 { OP_MAIN_PREV_UNDELETED, "<up>" },
282 { OP_MAIN_PREV_UNDELETED, "k" },
283 { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r>
284 { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R>
285 { OP_MAIN_SET_FLAG, "w" },
286 { OP_MAIN_SYNC_FOLDER, "$" },
287 { OP_NEXT_ENTRY, "J" },
288 { OP_NEXT_LINE, "<keypadenter>" },
289 { OP_NEXT_LINE, "\n" }, // <Enter>
290 { OP_NEXT_LINE, "\r" }, // <Return>
291 { OP_NEXT_PAGE, " " }, // <Space>
292 { OP_NEXT_PAGE, "<pagedown>" },
293 { OP_PAGER_BOTTOM, "<end>" },
294 { OP_PAGER_HIDE_QUOTED, "T" },
295 { OP_PAGER_SKIP_HEADERS, "H" },
296 { OP_PAGER_SKIP_QUOTED, "S" },
297 { OP_PAGER_TOP, "<home>" },
298 { OP_PAGER_TOP, "^" },
299 { OP_PIPE, "|" },
300 { OP_PREV_ENTRY, "K" },
301 { OP_PREV_LINE, "<backspace>" },
302 { OP_PREV_PAGE, "-" },
303 { OP_PREV_PAGE, "<pageup>" },
304 { OP_PRINT, "p" },
305 { OP_QUIT, "Q" },
306 { OP_RECALL_MESSAGE, "R" },
307 { OP_REDRAW, "\014" }, // <Ctrl-L>
308 { OP_REPLY, "r" },
309 { OP_RESEND, "\033e" }, // <Alt-e>
310 { OP_SAVE, "s" },
311 { OP_SEARCH, "/" },
312 { OP_SEARCH_NEXT, "n" },
313 { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/>
314 { OP_SEARCH_TOGGLE, "\\" }, // <Backslash>
315 { OP_SHELL_ESCAPE, "!" },
316 { OP_SORT, "o" },
317 { OP_SORT_REVERSE, "O" },
318 { OP_TAG, "t" },
319 { OP_TOGGLE_NEW, "N" },
320 { OP_TOGGLE_WRITE, "%" },
321 { OP_UNDELETE, "u" },
322 { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u>
323 { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U>
324 { OP_VERSION, "V" },
325 { OP_VIEW_ATTACHMENTS, "v" },
326 { 0, NULL },
327};

◆ PgpDefaultBindings

const struct MenuOpSeq PgpDefaultBindings[]
extern

Key bindings for the Pgp Menu.

Definition at line 64 of file functions.c.

64 { /* map: pgp */
65 { OP_EXIT, "q" },
66 { OP_VERIFY_KEY, "c" },
67 { OP_VIEW_ID, "%" },
68 { 0, NULL },
69};

◆ PostponedDefaultBindings

const struct MenuOpSeq PostponedDefaultBindings[]
extern

Key bindings for the Postpone Menu.

Definition at line 62 of file functions.c.

62 { /* map: postpone */
63 { OP_DELETE, "d" },
64 { OP_EXIT, "q" },
65 { OP_UNDELETE, "u" },
66 { 0, NULL },
67};

◆ QueryDefaultBindings

const struct MenuOpSeq QueryDefaultBindings[]
extern

Key bindings for the external Query Menu.

Definition at line 109 of file functions.c.

109 { /* map: query */
110 { OP_CREATE_ALIAS, "a" },
111 { OP_EXIT, "q" },
112 { OP_MAIL, "m" },
113 { OP_MAIN_LIMIT, "l" },
114 { OP_MAIN_TAG_PATTERN, "T" },
115 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
116 { OP_QUERY, "Q" },
117 { OP_QUERY_APPEND, "A" },
118 { OP_SORT, "o" },
119 { OP_SORT_REVERSE, "O" },
120 { OP_TAG, "<space>" },
121 { 0, NULL },
122};

◆ SmimeDefaultBindings

const struct MenuOpSeq SmimeDefaultBindings[]
extern

Key bindings for the Smime Menu.

Definition at line 74 of file functions.c.

74 { /* map: smime */
75 { OP_EXIT, "q" },
76#ifdef CRYPT_BACKEND_GPGME
77 { OP_VERIFY_KEY, "c" },
78 { OP_VIEW_ID, "%" },
79#endif
80 { 0, NULL },
81};

◆ KeyCommands

const struct Command KeyCommands[]
static
Initial value:
= {
{ "bind", parse_bind, 0 },
{ "exec", parse_exec, 0 },
{ "macro", parse_macro, 1 },
{ "push", parse_push, 0 },
{ "unbind", parse_unbind, MUTT_UNBIND },
{ "unmacro", parse_unbind, MUTT_UNMACRO },
{ NULL, NULL, 0 },
}
enum CommandResult parse_push(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'push' command - Implements Command::parse() -.
Definition commands.c:309
enum CommandResult parse_bind(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'bind' command - Implements Command::parse() -.
Definition commands.c:328
enum CommandResult parse_unbind(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unbind' command - Implements Command::parse() -.
Definition commands.c:441
enum CommandResult parse_exec(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'exec' command - Implements Command::parse() -.
Definition commands.c:619
enum CommandResult parse_macro(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'macro' command - Implements Command::parse() -.
Definition commands.c:529
#define MUTT_UNBIND
Parse 'unbind' command.
Definition lib.h:49
#define MUTT_UNMACRO
Parse 'unmacro' command.
Definition lib.h:50

Key Binding Commands.

Definition at line 70 of file init.c.

70 {
71 // clang-format off
72 { "bind", parse_bind, 0 },
73 { "exec", parse_exec, 0 },
74 { "macro", parse_macro, 1 },
75 { "push", parse_push, 0 },
76 { "unbind", parse_unbind, MUTT_UNBIND },
77 { "unmacro", parse_unbind, MUTT_UNMACRO },
78 { NULL, NULL, 0 },
79 // clang-format on
80};