.vim/ftplugin/mail.vim

Wed, 03 Aug 2016 21:36:35 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 03 Aug 2016 21:36:35 -0400
changeset 363
394bcf0d5bac
parent 361
7ab7173fb61f
child 368
91d4fb4e0a42
permissions
-rw-r--r--

add POD highlighting for shell


function! JumpAndInsert()
  if line('$') > 1
    :0
    :/^$/
    :normal 2] 
    :+1
    :exe 'startinsert'
  endif
endfunction

function! AutoFmtToggle()
  if &formatoptions =~ 'a'
    set fo-=a
    echo '-a'
  else
    set fo+=a
    echo '+a'
  endif
endfunction

augroup mail_filetype
  autocmd!
  autocmd BufReadPost mutt-* :call JumpAndInsert()
augroup END

setl textwidth=72
setl formatoptions=aw
setl spell

map <silent> <leader>a :call AutoFmtToggle()<CR>
imap <silent> <leader>a :call AutoFmtToggle()<CR>

mercurial