Discussion:
Aliases
steve
2018-11-19 11:46:06 UTC
Permalink
Hi,

I'm using the alias functionality very often, but there is one thing
lacking or that I haven't found yet.

Let's say I have a group alias like this

alias group1 a,b,c,d

and a simple one like this

alias joe ***@example.com

Now, I would like to create a new message with m, then the TO field
appears and I type group1 which fills that field with the four
recipients. Then I get the subject field and then I can edit the message
with my editor, vim in my case.

Now if I want to add joe to the CC field, I cannot use the alias, I must
enter it manually. This case happens so often for me that I'm looking
for a way to simplify this process. I don't know if using aliases is the
right way to go, I don't see how to add joe to the group group1 AND ask
that it goes in the CC filed and not in the TO field.

Maybe should I try to create some kind of template pre-filled?

Any help and/or ideas would be highly appreciated.

Thank.

Best,
Steve
Anders Damsgaard
2018-11-19 12:16:23 UTC
Permalink
Hi Steve,

Maybe you are already aware of this plugin, but
https://github.com/vim-scripts/mutt-aliases allows you to autocomplete
aliases from insert mode in vim, which is useful if you `set
edit_headers` in your muttrc. In your example you would input group1 as
the recipients (`To: `) field in mutt, and type `joe@@` in the `Cc: `
field in vim.

Cheers, Anders

--
Anders Damsgaard
--
Academia: https://adamsgaard.dk
Photography: https://andersdamsgaard.com
PGP public key: https://adamsgaard.dk/ad-public-key.txt
Felix Finch
2018-11-19 14:20:29 UTC
Permalink
Post by steve
Hi,
I'm using the alias functionality very often, but there is one thing
lacking or that I haven't found yet.
Let's say I have a group alias like this
alias group1 a,b,c,d
and a simple one like this
Now, I would like to create a new message with m, then the TO field
appears and I type group1 which fills that field with the four
recipients. Then I get the subject field and then I can edit the message
with my editor, vim in my case.
Now if I want to add joe to the CC field, I cannot use the alias, I must
enter it manually. This case happens so often for me that I'm looking
for a way to simplify this process. I don't know if using aliases is the
right way to go, I don't see how to add joe to the group group1 AND ask
that it goes in the CC filed and not in the TO field.
You can use aliases in the editor, they just don't autocomplete. Put "joe" in
the Cc: header with the editor; when mutt picks up the edited email, it expands
it. The few times I forget someone's alias and would otherwise rely on mutt
expansion, I edit the alias file to remind myself.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / ***@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
Jude DaShiell
2018-11-19 14:48:08 UTC
Permalink
has askcc=yes been set in the .muttrc file? If yes, why does the use of
aliases block the prompt from being displayed?
Date: Mon, 19 Nov 2018 09:20:29
Subject: Re: Aliases
Post by steve
Hi,
I'm using the alias functionality very often, but there is one thing
lacking or that I haven't found yet.
Let's say I have a group alias like this
alias group1 a,b,c,d
and a simple one like this
Now, I would like to create a new message with m, then the TO field
appears and I type group1 which fills that field with the four
recipients. Then I get the subject field and then I can edit the message
with my editor, vim in my case.
Now if I want to add joe to the CC field, I cannot use the alias, I must
enter it manually. This case happens so often for me that I'm looking
for a way to simplify this process. I don't know if using aliases is the
right way to go, I don't see how to add joe to the group group1 AND ask
that it goes in the CC filed and not in the TO field.
You can use aliases in the editor, they just don't autocomplete. Put "joe" in
the Cc: header with the editor; when mutt picks up the edited email, it expands
it. The few times I forget someone's alias and would otherwise rely on mutt
expansion, I edit the alias file to remind myself.
--
steve
2018-11-19 14:48:38 UTC
Permalink
Post by Felix Finch
Post by steve
Now if I want to add joe to the CC field, I cannot use the alias, I must
enter it manually. This case happens so often for me that I'm looking
for a way to simplify this process. I don't know if using aliases is the
right way to go, I don't see how to add joe to the group group1 AND ask
that it goes in the CC filed and not in the TO field.
You can use aliases in the editor, they just don't autocomplete. Put "joe" in
the Cc: header with the editor; when mutt picks up the edited email, it expands
it.
This is fantastic! And it works for any number of aliases, in To or Bcc
fields. And even after reediting the message.

Exactly what I needed.


Thank you very much.

Best,
Steve
Thomas Schneider
2018-11-20 03:07:39 UTC
Permalink
This post might be inappropriate. Click to display it.
Felix Finch
2018-11-20 05:37:40 UTC
Permalink
Post by Thomas Schneider
I would just add 'joe' to the CC line in vim. Then I quit vim and go
map ; :wq^M
(where '^M' is a control M)
it takes only two characters: ';e'!
You could use "ZZ", only one char more and skips the mapping.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / ***@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
Thomas Schneider
2018-11-20 06:26:39 UTC
Permalink
Post by Felix Finch
You could use "ZZ", only one char more and skips the mapping.
Well, I have mapped Z to insert my .sig file. Removing that I tried
ZZ and found that it did not bring me back into vim. Also, you have
to hold the shift key down. ';e' is very fast and minimal!

';' has other uses - a quick escape from vim by one character. Also I
map ',' to mean ':w^M' so I can write the file out quickly. Usually I
have my atchange program watching the file to do whatever I want (like
run a program or typeset in LaTeX).

Tom
Cameron Simpson
2018-11-21 04:57:01 UTC
Permalink
Post by Thomas Schneider
Post by Felix Finch
You could use "ZZ", only one char more and skips the mapping.
Well, I have mapped Z to insert my .sig file.
I have mutt do that for me pre-edit.
Post by Thomas Schneider
Removing that I tried
ZZ and found that it did not bring me back into vim. Also, you have
to hold the shift key down. ';e' is very fast and minimal!
';' has other uses - a quick escape from vim by one character.
I use "q" for that (mapped to "ZZ"). Just like mutt itself; surely
anything else is disloyal?
Post by Thomas Schneider
Also I
map ',' to mean ':w^M' so I can write the file out quickly. Usually I
have my atchange program watching the file to do whatever I want (like
run a program or typeset in LaTeX).
I used to have ^W mapped to ':w^M'. Until I started using vim's nice
"window" stuff to split my terminal up when editing, all of whose
actions commence with ^W.

So now I just have q mapped to ZZ (quit, saving file if modified).

Cheers,
Cameron Simpson <***@cskk.id.au>

Jon LaBadie
2018-11-20 07:02:57 UTC
Permalink
Post by Thomas Schneider
I would just add 'joe' to the CC line in vim. Then I quit vim and go
map ; :wq^M
(where '^M' is a control M)
it takes only two characters: ';e'!
I'd hate to give up the ';' as a normal vim command.
My goto for an impromptu mapping is double comma ',,'.

jl
--
Jon H. LaBadie ***@jgcomp.com
11226 South Shore Rd. (703) 787-0688 (H)
Reston, VA 20190 (703) 935-6720 (C)
Loading...