On 23-Jul-1999, Steve Crane wrote:
> Earlier this week someone recommended adding
>   set editor ="vim +'/^[ ,\t]*> --/,/^-- /-2d'"
> to .muttrc to strip out the signature on a reply so I implemented this.
> It works fine but but if the regexp is not found (when sending a new
> message for instance), I get an error message and must press return to
> continue.  This is rather irritating and I was wondering if there is any
> way around it.

This is what I use, a less strict modification on someone's suggestion
probably in this list or vim list. In .vimrc:

   au BufRead mutt-fluke* normal :g/^> *[-_]\{2,} *$/,/^$/-1d
gg

Notes:
1. mutt-fluke* is the pattern for temp files created by mutt,
   fluke is my machine, change it to yours, or maybe you can use
   'mutt-*', or dynamically get the hostname
2. the sig delimeter I use is not only dash-dash-space, also including
   more than two dashes or underscores (eg. Hotmail's annoying "Get
   your free email..."), will delete everything from
   that line up to the first blank line, press enter in case search
   fails, refresh screen and go to the first line.

If you want strictly dash-dash-space for sig delimeter:

   au BufRead mutt-fluke* normal :g/^> *-- $/,/^$/-1d
gg

PS. To insert a real ^M, type Ctrl-V-M or Ctrl-V Ctrl-M.

Hope that helps,

-- 
Ronny Haryanto

Reply via email to