Use Multiple Alias Files#
Prerequisites#
A working alias setup (see Using the Address Book).
Split Contacts into Separate Files#
Create one file per group:
touch ~/.config/neomutt/aliases-personal
touch ~/.config/neomutt/aliases-work
Move the relevant aliases into each file:
~/.config/neomutt/aliases-personal:
alias alice Alice Example <alice@example.com> # tags:friends
alias bob Bob Builder <bob@example.com>
~/.config/neomutt/aliases-work:
alias carol Carol Davis <carol@company.com> # tags:work
alias dave Dave Evans <dave@company.com> # tags:work
Load All Alias Files#
Source each file in your
neomuttrc:
source ~/.config/neomutt/aliases-personal
source ~/.config/neomutt/aliases-work
Expected result: all aliases from both files are available at address prompts.
Set alias_file for Interactive Saves#
$alias_file can point to only one file.
New aliases created with <create-alias> (pressing a on a message) are saved there.
Choose the file you want new aliases saved to:
set alias_file = "~/.config/neomutt/aliases-personal"
Expected result: pressing a on a message appends the alias to the personal file.
Reload After Changes#
After editing any alias file, reload it:
:source ~/.config/neomutt/aliases-work
Or reload all files at once by re-sourcing your main config:
:source ~/.config/neomutt/neomuttrc
Expected result: changes take effect without restarting NeoMutt.
See Manage Aliases for the full alias syntax and Using the Address Book for the setup tutorial.