.vim/ftplugin/mail.vim

changeset 368
91d4fb4e0a42
parent 361
7ab7173fb61f
child 387
d16b5c66461a
equal deleted inserted replaced
367:a9ef42db273e 368:91d4fb4e0a42
7 :+1 7 :+1
8 :exe 'startinsert' 8 :exe 'startinsert'
9 endif 9 endif
10 endfunction 10 endfunction
11 11
12 function! AutoFmtToggle()
13 if &formatoptions =~ 'a'
14 set fo-=a
15 echo '-a'
16 else
17 set fo+=a
18 echo '+a'
19 endif
20 endfunction
21
22 augroup mail_filetype 12 augroup mail_filetype
23 autocmd! 13 autocmd!
24 autocmd BufReadPost mutt-* :call JumpAndInsert() 14 autocmd BufReadPost mutt-* :call JumpAndInsert()
25 augroup END 15 augroup END
26 16
27 setl textwidth=72 17 setl textwidth=72
28 setl formatoptions=aw 18 setl formatoptions+=awt12
29 setl spell 19 setl spell
30
31 map <silent> <leader>a :call AutoFmtToggle()<CR>
32 imap <silent> <leader>a :call AutoFmtToggle()<CR>

mercurial