Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #228 - Deleting nested reply threads in emails

Created: March 24, 2002 16:39 Complexity: intermediate Author: Darren Greaves Version: 6.0 Karma: 3/4 Imported from: Tip#228

I find the following setting useful when replying to email threads that have lots of lines like the following:

> blah 
> > blah 
> > > blah 
autocmd FileType mail map <F8> :%g/^> >/d<CR> 

When replying to a mail and you want to remove everything except what the person you are directly replying to wrote just press F8.

From the example above, you would just be left with

> blah 

What it does is simply match any line starting with > > and deletes it. It's not perfect as sigs and other debris may remain but it takes a lot of the grunt work out of replying to mails.

The autocmd only maps F8 when using mails, this is handy if you use F8 for other things as I do.

References

Comments

why not just put the mapping in the ftplugin/mail.vim file?

map <buffer> <f8> :g/. . .

salmanhalim--AT--hotmail.com , March 25, 2002 6:15


Have a look at Brian Medley's email ftplugin.

--Luc Hermitte 13:56, 14 August 2007 (UTC)


Advertisement