X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2ce54215a99b0a31154a468ad0aa56974c6fbefc..2f977b1ab25c12705d441fc0809f01543c8efb31:/.vim/after/ftplugin/mail.vim?ds=sidebyside diff --git a/.vim/after/ftplugin/mail.vim b/.vim/after/ftplugin/mail.vim index 8c59b11..67bd38c 100644 --- a/.vim/after/ftplugin/mail.vim +++ b/.vim/after/ftplugin/mail.vim @@ -6,6 +6,8 @@ setlocal formatoptions+=a setlocal formatoptions+=w setlocal formatoptions+=n +setlocal comments=n:> + "setlocal spell augroup tsperrorinsert @@ -126,15 +128,19 @@ augroup fixquotes augroup END nmap :w:%!mailplate --keep-unknown official -nmap :w:%!mailplate --keep-unknown tahi -nmap :w:%!mailplate --keep-unknown pmvm -nmap :w:%!mailplate --keep-unknown pobox -nmap :w:%!mailplate --keep-unknown debian -nmap :w:%!mailplate --keep-unknown debconf -nmap :w:%!mailplate --keep-unknown uniwh -nmap :w:%!mailplate --keep-unknown mtfk -nmap :w:%!mailplate --keep-unknown sudetia -nmap :w:%!mailplate --keep-unknown private +nmap :w:%!mailplate --keep-unknown pobox +nmap :w:%!mailplate --keep-unknown tahi +nmap :w:%!mailplate --keep-unknown toni + +nmap :w:%!mailplate --keep-unknown kbkg +nmap :w:%!mailplate --keep-unknown krafftwerk +nmap :w:%!mailplate --keep-unknown siby +nmap :w:%!mailplate --keep-unknown debian + +nmap :w:%!mailplate --keep-unknown uniwh +nmap :w:%!mailplate --keep-unknown mtfk +nmap :w:%!mailplate --keep-unknown sudetia +nmap :w:%!mailplate --keep-unknown default nmap :w:%!mailplate --auto --keep-unknown 2>/dev/null " change subject line @@ -193,4 +199,18 @@ fun! DelegateCompletion(next) endif endfun -autocmd BufWritePost exe 'write ' . fnameescape((exists('$TMPDIR') ? expand('$TMPDIR') : '/tmp') . '/mail.backup.' . strftime('%Y-%m-%d-%H%M%S')) +function! WriteMailBackup() + let l:tmpdir = fnameescape((exists('$TMPDIR') ? expand('$TMPDIR') : '/tmp')) + let l:tgtdir = l:tmpdir . '/mail-backups' + call mkdir(l:tgtdir, "p", 0o700) + let l:modified = &modified + let l:filename = l:tgtdir . '/' . strftime('%Y-%m-%d-%H%M%S') . '.msg' + exe 'silent update! ' . l:filename + if 0 && l:modified + echo 'Backup written to ' . l:filename + endif +endfunction +autocmd BufWritePre call WriteMailBackup() + +let g:markdown_in_mail = 1 +runtime! ftplugin/markdown.vim