On Sun, Mar 21, 2021 at 12:15:23PM +0100, Francesco wrote in <20210321111523.GA10364@extensa>:
Hello mutters,
   how can I automate typing standard replies?

Example: say I want to type «lgtm» (top post) as a reply to a message,
as now I have to:
- press `r` (reply)
- press `i` (my editor is Vim)
- «lgtm»
- then <C-[> (exit insert mode)
- ZZ         (exit/save file)
- finally `y` to send

Is there a way to one-button this? I thought about a macro,
but I suspect that wouldn’t work, since I am firing up an
editor.

I can think of a few ways you can make a macro work for you:

1) In the macro, change the attribution to what you want to include at the top.
Edit your message as desired, proceed as normal (reset attribution).

2) In the macro, change the signature to what you want to include at the bottom.
Edit your message as desired, proceed as normal (reset signature).

3) In the macro, change your editor to a script (sed?) that mangles your message
as you want it. Reset the editor to vim.

There are probably other ways to do it too, but I hope this might get you going.

Kind regards,

Remco

Reply via email to