blob: 4a4c85195c51fd6711c2deac5b85a5512b5254d1 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: Mail
3" Maintainer: Bram Moolenaar <Bram@vim.org>
Bram Moolenaar5c736222010-01-06 20:54:52 +01004" Last Change: 2009 Jun 03
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
6" Only do this when not done yet for this buffer
7if exists("b:did_ftplugin")
8 finish
9endif
10let b:did_ftplugin = 1
11
12let b:undo_ftplugin = "setl modeline< tw< fo<"
13
Bram Moolenaar9964e462007-05-05 17:54:07 +000014" Don't use modelines in e-mail messages, avoid trojan horses and nasty
15" "jokes" (e.g., setting 'textwidth' to 5).
Bram Moolenaar071d4272004-06-13 20:20:40 +000016setlocal nomodeline
17
18" many people recommend keeping e-mail messages 72 chars wide
19if &tw == 0
20 setlocal tw=72
21endif
22
23" Set 'formatoptions' to break text lines and keep the comment leader ">".
24setlocal fo+=tcql
25
Bram Moolenaar5c736222010-01-06 20:54:52 +010026" Add mappings, unless the user doesn't want this.
Bram Moolenaar071d4272004-06-13 20:20:40 +000027if !exists("no_plugin_maps") && !exists("no_mail_maps")
28 " Quote text by inserting "> "
29 if !hasmapto('<Plug>MailQuote')
30 vmap <buffer> <LocalLeader>q <Plug>MailQuote
31 nmap <buffer> <LocalLeader>q <Plug>MailQuote
32 endif
33 vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>:noh<CR>``
34 nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>:noh<CR>``
35endif