annotate runtime/ftplugin/mail.vim @ 34147:efe7982ac118

Added tag v9.1.0034 for changeset 23bb675796f066d27bdcdc42afdcedfe2d55e120
author Christian Brabandt <cb@256bit.org>
date Tue, 16 Jan 2024 17:30:11 +0100
parents 4027cefc2aab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Mail
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 26100
diff changeset
3 " Maintainer: The Vim Project <https://github.com/vim/vim>
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 26100
diff changeset
4 " Last Change: 2023 Aug 10
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 26100
diff changeset
5 " Former Maintainer: Bram Moolenaar <Bram@vim.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3967
fdb8a9c7bd91 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
13 let b:undo_ftplugin = "setl modeline< tw< fo< comments<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 7
diff changeset
15 " Don't use modelines in e-mail messages, avoid trojan horses and nasty
e63691e7c504 updated for version 7.1a
vimboss
parents: 7
diff changeset
16 " "jokes" (e.g., setting 'textwidth' to 5).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal nomodeline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " many people recommend keeping e-mail messages 72 chars wide
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 if &tw == 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 setlocal tw=72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Set 'formatoptions' to break text lines and keep the comment leader ">".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 setlocal fo+=tcql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3967
fdb8a9c7bd91 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
27 " Add n:> to 'comments, in case it was removed elsewhere
fdb8a9c7bd91 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
28 setlocal comments+=n:>
fdb8a9c7bd91 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
29
26100
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
30 " .eml files are universally formatted with DOS line-endings, per RFC5322.
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
31 " If the file was not DOS the it will be marked as changed, which is probably
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
32 " a good thing.
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
33 if expand('%:e') ==? 'eml'
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
34 let b:undo_ftplugin ..= " fileformat=" .. &fileformat
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
35 setlocal fileformat=dos
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
36 endif
babd9f1dbe12 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 3967
diff changeset
37
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1121
diff changeset
38 " Add mappings, unless the user doesn't want this.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 if !exists("no_plugin_maps") && !exists("no_mail_maps")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " Quote text by inserting "> "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if !hasmapto('<Plug>MailQuote')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 vmap <buffer> <LocalLeader>q <Plug>MailQuote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 nmap <buffer> <LocalLeader>q <Plug>MailQuote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>:noh<CR>``
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>:noh<CR>``
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 endif