Remove old signature
Hi, After having searching on the web and in the archives, I come to you for this small question. When replying ('r') mutt can add a chosen signature but cannot remove the old one, i.e the one from the sender. In the FAQ, it's written that mutt cannot strip automaticaly signatures since this should be the editor's job (vim in my case). But why so ? Any pointers on how to do that with vim ? Thanks -- Steve
Re: Remove old signature
* steve on Tuesday, December 02, 2008 at 14:55:18 +0100 > In the FAQ, it's written that mutt cannot strip automaticaly signatures > since this should be the editor's job (vim in my case). But why so ? Yet another option ... > Any pointers on how to do that with vim ? On startup: silent! g/^> \?-- $/,$ delete or manually: nnoremap qs :/^> \?-- $/,/^-- $/-dnoh eg. in ~/.vim/after/ftplugin/mail.vim Adjust to taste. c -- \black\trash movie_C O W B O Y_ _C A N O E_ _C O M A_ Ein deutscher Western/A German Western -->> http://www.blacktrash.org/underdogma/ccc.html -->> http://www.blacktrash.org/underdogma/ccc-en.html
Re: Remove old signature
Le 02-12-2008, à 15:20:21 +0100, Christian Ebert ([EMAIL PROTECTED]) a écrit : > * steve on Tuesday, December 02, 2008 at 14:55:18 +0100 > > In the FAQ, it's written that mutt cannot strip automaticaly signatures > > since this should be the editor's job (vim in my case). But why so ? > > Yet another option ... Ok ... > > Any pointers on how to do that with vim ? > > On startup: > > silent! g/^> \?-- $/,$ delete Ok, I fell on one of those too. The question is how do I integrate that line in .muttrc ? I tried : set editor="vim -c 'set textwidth=72' -c 'silent! g/^> \?-- $/,$ delete'" but it doesn't work, the old signature is still there. What did I do wrong ? > or manually: > > nnoremap qs :/^> \?-- $/,/^-- $/-dnoh Still a lot too complicated for me .. > eg. in ~/.vim/after/ftplugin/mail.vim > > Adjust to taste. Thanks for your help. -- Steve
Re: Remove old signature
* steve on Tuesday, December 02, 2008 at 15:33:54 +0100 > Le 02-12-2008, à 15:20:21 +0100, Christian Ebert ([EMAIL PROTECTED]) a écrit : >> * steve on Tuesday, December 02, 2008 at 14:55:18 +0100 >>> Any pointers on how to do that with vim ? >> >> On startup: >> >> silent! g/^> \?-- $/,$ delete > > Ok, I fell on one of those too. The question is how do I integrate that > line in .muttrc ? > > I tried : > > set editor="vim -c 'set textwidth=72' -c 'silent! g/^> \?-- $/,$ > delete'" > > but it doesn't work, the old signature is still there. What did I do > wrong ? Probably you need to escape some of the "\"; you'd have to try. I prefer to have this (and more) in a function MailStart in ~/.vim/after/ftplugin/mail.vim, and then simply have set editor='vim -X -c "call MailStart()"' in my muttrc -- much easier to tweak or turn off in hooks as well. Saves me to try hundreds of escape combinations in muttrc. So I am also too lazy to do it for you ;-) btw. you don't need tw=72. That's already on by default for ft=mail. c -- \black\trash movie_C O W B O Y_ _C A N O E_ _C O M A_ Ein deutscher Western/A German Western -->> http://www.blacktrash.org/underdogma/ccc.html -->> http://www.blacktrash.org/underdogma/ccc-en.html
Re: Remove old signature
Le 02-12-2008, à 15:57:06 +0100, Christian Ebert ([EMAIL PROTECTED]) a écrit : > * steve on Tuesday, December 02, 2008 at 15:33:54 +0100 > > Le 02-12-2008, à 15:20:21 +0100, Christian Ebert ([EMAIL PROTECTED]) a > > écrit : > >> * steve on Tuesday, December 02, 2008 at 14:55:18 +0100 > >>> Any pointers on how to do that with vim ? > >> > >> On startup: > >> > >> silent! g/^> \?-- $/,$ delete > > > > Ok, I fell on one of those too. The question is how do I integrate that > > line in .muttrc ? > > > > I tried : > > > > set editor="vim -c 'set textwidth=72' -c 'silent! g/^> \?-- $/,$ > > delete'" > > > > but it doesn't work, the old signature is still there. What did I do > > wrong ? > > Probably you need to escape some of the "\"; you'd have to try. I will. > I prefer to have this (and more) in a function MailStart in > ~/.vim/after/ftplugin/mail.vim, and then simply have > > set editor='vim -X -c "call MailStart()"' > > in my muttrc -- much easier to tweak or turn off in hooks as > well. Saves me to try hundreds of escape combinations in muttrc. > So I am also too lazy to do it for you ;-) Ok thanks for the hints, I'll give them a try tomorrow, end of the day for me now. > btw. you don't need tw=72. That's already on by default for > ft=mail. ok, didn't know that. Many thanks Christian for your help. -- steve
Re: Remove old signature
> Any pointers on how to do that with vim ? I don't let my editor (vi, not vim) strip signatures automatically. Sometimes I want to comment on the signature in my reply. I have a vi macro for signature-stripping: "" From main.d/070.delsig: "" Remove quoted signature, up to blank line map ; :/^[ ]*> -- *$/;?^[ >][ >]*$?;.,/^[ ]*$/-1d All the sequences of whitespace above are , and the ^M is a control-M, not a caret and an M. Be sure to fix that if you copy and paste. Vim should be able to use this too -- if not, its vi compatibility is worse than I thought. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago