home of the madduck/ code/ mailplate/
vim filter

I am often editing a message with vim and find that I need to use a different identity. For this purpose, I have the following keybindings in my ~/.vimrc:

nmap <buffer> <F1>      :w<CR>:%!mailplate --keep-unknown --auto<CR>
nmap <buffer> <C-P><F1> :w<CR>:%!mailplate --keep-unknown private<CR>
nmap <buffer> <C-P><F2> :w<CR>:%!mailplate --keep-unknown debian<CR>

Now when I reply to a message, mailplate automatically choses the right template, and if I later change my mind, I can press C-p,<F1> to override the choice and select the private template, or just hit <F1> to have it re-run the auto-detection.