Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: Mail |
| 3 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
| 4 | " Last Change: 2004 Feb 20 |
| 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 | |
| 12 | let b:undo_ftplugin = "setl modeline< tw< fo<" |
| 13 | |
| 14 | " Don't use modelines in e-mail messages, avoid trojan horses |
| 15 | setlocal nomodeline |
| 16 | |
| 17 | " many people recommend keeping e-mail messages 72 chars wide |
| 18 | if &tw == 0 |
| 19 | setlocal tw=72 |
| 20 | endif |
| 21 | |
| 22 | " Set 'formatoptions' to break text lines and keep the comment leader ">". |
| 23 | setlocal fo+=tcql |
| 24 | |
| 25 | " Add mappings, unless the user didn't want this. |
| 26 | if !exists("no_plugin_maps") && !exists("no_mail_maps") |
| 27 | " Quote text by inserting "> " |
| 28 | if !hasmapto('<Plug>MailQuote') |
| 29 | vmap <buffer> <LocalLeader>q <Plug>MailQuote |
| 30 | nmap <buffer> <LocalLeader>q <Plug>MailQuote |
| 31 | endif |
| 32 | vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>:noh<CR>`` |
| 33 | nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>:noh<CR>`` |
| 34 | endif |