[
    {
        "role": "user",
        "content": "in%20neomutt%2C%20how%20to%20create%20an%20alias%20on%20the%20fly%20(dynamically%3F)"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s how to create aliases *on the fly* (dynamically) in Neomutt, plus how to make them persist, etc.\n\n---\n\n### What \u201calias on the fly\u201d usually means in Neomutt\n\nIt typically means:\n\n- While reading or after selecting a message (e.g. in the index or pager view), creating an alias from the sender of that message.\n- Or more generally, defining a shortcut alias without needing to edit your config and restart (or source) manually.\n\nNeomutt supports this via the `<create-alias>` function, which is by default bound to the key `a`. ([neomutt.org](https://neomutt.org/guide/gettingstarted.html?utm_source=openai))\n\n---\n\n### How to use `<create-alias>` interactively\n\nWhen you're in the **index** or **pager** view and you see a message from someone you want to alias:\n\n1. Press `a` (which is the default binding for `<create-alias>`). ([neomutt.org](https://neomutt.org/guide/gettingstarted.html?utm_source=openai))\n2. Neomutt will prompt you for:\n   - the alias (short key name) you want to use,\n   - possibly a \u201creal name\u201d (personal name), and\n   - the email address (which defaults to the current message\u2019s sender).  \n3. Once confirmed, this alias gets added to your alias list\u2014and *saved* in the file configured by `$alias_file`. By default that\u2019s `~/.neomuttrc`. ([neomutt.org](https://neomutt.org/guide/configuration?utm_source=openai))\n\nSo yes, that\u2019s how you *dynamically* create shortcuts without editing your config manually.\n\n---\n\n### Making them persistent (for future sessions)\n\n- The value of `$alias_file` determines where newly-created aliases are saved. By default, this is `~/.neomuttrc`, but you can set a different file. ([neomutt.org](https://neomutt.org/guide/reference.html?utm_source=openai))\n- After Neomutt writes the alias into `$alias_file`, that file **must** be sourced in your config (or loaded on startup) so that the alias definitions are active. If you use a separate alias file, you might do something like:\n  ```text\n  source ~/.mail_aliases\n  set alias_file=~/.mail_aliases\n  ```\n  ([neomutt.org](https://neomutt.org/guide/configuration?utm_source=openai))\n\n---\n\n### Example workflow\n\nHere\u2019s a minimal example to illustrate:\n\n- Say you get an email from `sally@example.com` with the name \u201cSally Jones\u201d.\n- While viewing it in the index:\n  1. Press `a`\n  2. At the prompt:\n     ```\n     Create alias for: Sally Jones <sally@example.com>\n     Alias name: sally\n     (optionally: real name, etc.)\n     ```\n  3. Neomutt writes into your `$alias_file`, e.g.:\n     ```\n     alias sally Sally Jones <sally@example.com>\n     ```\n- Next time you compose, in the \u201cTo:\u201d prompt you can type `sally` + TAB to expand, or just `sally` if alias expansion is automatic.\n\n---\n\n### Advanced / additional notes\n\n- If you already have lots of aliases, pressing `<Tab>` at an address prompt will either complete a partial alias or show matches. ([neomutt.org](https://neomutt.org/guide/configuration?utm_source=openai))\n- You can also manage aliases in the *alias menu*, including adding, deleting, and tagging aliases. The alias menu can be opened via commands or keybindings. ([code.neomutt.org](https://code.neomutt.org/alias_dlg_alias.html?utm_source=openai))\n\n---\n\nIf you like, I can show you how to bind the `<create-alias>` function to a different key (or in a different menu), or how to set up tag-based alias groups. Do you want examples for that?"
    }
]