X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=contrib%2Fabook%2Bvim%2Fmail.vim;fp=contrib%2Fabook%2Bvim%2Fmail.vim;h=bdc313447298e764d6d97e56804ac1ebf702d80b;hb=9d28f71348269e7075d0ff5c0b7ae4e05f358304;hp=0000000000000000000000000000000000000000;hpb=c0b0c6c7a0971525558239e544212589fbbac58b;p=pkg%2Fabook.git diff --git a/contrib/abook+vim/mail.vim b/contrib/abook+vim/mail.vim new file mode 100644 index 0000000..bdc3134 --- /dev/null +++ b/contrib/abook+vim/mail.vim @@ -0,0 +1,530 @@ +" mail FTplugin +" +" Requires vim 6.x. +" To install place in ~/.vim/after/ftplugin/mail.vim +" +" Author: Brian Medley +" Email: freesoftware@4321.tv +" +" This file was modified from Cedric Duval's version. +" http://cedricduval.free.fr/download/vimrc/mail + +" Only do this when not done yet for this buffer +if exists("b:did_mail_after_ftplugin") + finish +endif +let b:did_mail_after_ftplugin = 1 + +if !exists ("mail_alias_program") + let mail_alias_program="Abook" +endif + +" ==================================================================== +" Globals +" ==================================================================== + +if !exists ("mail_quote_chars") + let s:quote_chars = ':!|>' +else + let s:quote_chars = mail_quote_chars +endif + +" This re defines a 'quote' +let s:quote_re = '\(\s\?\w*[' . s:quote_chars . ']\)' +" \s\? => 0 or one whitespace char +" (b/c some ppl put +" spaces in the quote, +" and others don't) +" +" \w* => maybe word chars (b/c +" some ppl put initals in +" the quotes) +" the rest => actual quote chars +" \( \) => this is a quote "level" + +" This re defines the quoting level at the *beginning* of a line +let s:quote_start = '^' . s:quote_re . s:quote_re . '*' +" ^s:quote_re => quote at beginning of +" line +" s:quote_re* => perhaps followed by +" more quotes + +" For debugging: +" let b:quote_chars = s:quote_chars +" let b:quote_re = s:quote_re +" let b:quote_start = s:quote_start + +" ==================================================================== +" Mappings +" ==================================================================== + +if !exists("no_plugin_maps") && !exists("no_mail_maps") + + " + " get alias list mappings + " + if !hasmapto('MailAliasList', 'n') + nmap al MailAliasList + endif + if !hasmapto('MailAliasList', 'i') + imap al MailAliasList + endif + + nnoremap