7
|
1 " Vim filetype plugin file
|
|
2 " Language: Mail
|
|
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
|
3967
|
4 " Last Change: 2012 Nov 20
|
7
|
5
|
|
6 " Only do this when not done yet for this buffer
|
|
7 if exists("b:did_ftplugin")
|
|
8 finish
|
|
9 endif
|
|
10 let b:did_ftplugin = 1
|
|
11
|
3967
|
12 let b:undo_ftplugin = "setl modeline< tw< fo< comments<"
|
7
|
13
|
1121
|
14 " Don't use modelines in e-mail messages, avoid trojan horses and nasty
|
|
15 " "jokes" (e.g., setting 'textwidth' to 5).
|
7
|
16 setlocal nomodeline
|
|
17
|
|
18 " many people recommend keeping e-mail messages 72 chars wide
|
|
19 if &tw == 0
|
|
20 setlocal tw=72
|
|
21 endif
|
|
22
|
|
23 " Set 'formatoptions' to break text lines and keep the comment leader ">".
|
|
24 setlocal fo+=tcql
|
|
25
|
3967
|
26 " Add n:> to 'comments, in case it was removed elsewhere
|
|
27 setlocal comments+=n:>
|
|
28
|
2034
|
29 " Add mappings, unless the user doesn't want this.
|
7
|
30 if !exists("no_plugin_maps") && !exists("no_mail_maps")
|
|
31 " Quote text by inserting "> "
|
|
32 if !hasmapto('<Plug>MailQuote')
|
|
33 vmap <buffer> <LocalLeader>q <Plug>MailQuote
|
|
34 nmap <buffer> <LocalLeader>q <Plug>MailQuote
|
|
35 endif
|
|
36 vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>:noh<CR>``
|
|
37 nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>:noh<CR>``
|
|
38 endif
|