Speed Up Address Book Access with Key Bindings#
Prerequisites#
A working alias setup (see Using the Address Book).
Create a Macro to Save and Reload Aliases#
The default <create-alias> (a) appends to $alias_file but doesn’t reload it.
Create a macro that saves and reloads in one step:
macro index,pager A "<create-alias><enter-command>source $alias_file<Enter>" "Save alias and reload"
Open a message and press A.
Expected result: the alias is saved and immediately available without a manual :source.
Bind a Key for External Queries#
If you use $query_command (abook, khard, LDAP):
Bind a key for quick queries from the index:
bind index,pager Q <query>
Press Q, enter a search term, and select a result.
Expected result: the query menu opens and you can compose a message to the selected address.
Create a Macro to Open a Specific Alias File#
If you split aliases into multiple files, you can create a macro to edit one quickly:
macro index,pager \ea "<shell-escape>$EDITOR ~/.config/neomutt/aliases-work<Enter><enter-command>source ~/.config/neomutt/aliases-work<Enter>" "Edit and reload work aliases"
Expected result: pressing Alt-a opens your editor on the work alias file, and reloads it when you return.
See Customise Key Bindings for the full :bind and :macro syntax and Macros for more macro examples.