aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/mail.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-01-01 16:08:21 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-01-01 16:09:11 +1300
commit80227fc6263ca864227de8b9d8d9f93f19ad173a (patch)
treef0183af0e7fc5a73cc2427653ac7fd67a3848a2e /vim/after/ftplugin/mail.vim
parentAdd trailing commas (diff)
downloaddotfiles-80227fc6263ca864227de8b9d8d9f93f19ad173a.tar.gz
dotfiles-80227fc6263ca864227de8b9d8d9f93f19ad173a.zip
Reimplement mail header importance flagging
Just for fun, write something a little more comprehensive to read in the entire mail header as a data structure, in order to add or set header fields correctly. I don't think this is totally RFC-compliant yet; I'll need to check.
Diffstat (limited to 'vim/after/ftplugin/mail.vim')
-rw-r--r--vim/after/ftplugin/mail.vim17
1 files changed, 12 insertions, 5 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index f81be691..dbb2f7c5 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -9,10 +9,14 @@ let b:undo_ftplugin .= '|delcommand SuggestStart'
SuggestStart
" Normalise quoting
-command -buffer -bar -range=% StrictQuote
+command -bar -buffer -range=% StrictQuote
\ call mail#StrictQuote(<q-line1>, <q-line2>)
let b:undo_ftplugin .= '|delcommand StrictQuote'
+command -bar -buffer -nargs=1 SetImportance
+ \ call mail#importance#Set(<f-args>)
+let b:undo_ftplugin .= '|delcommand SetImportance'
+
" Add a space to the end of wrapped lines for format-flowed mail
setlocal formatoptions+=w
let b:undo_ftplugin .= '|setlocal formatoptions<'
@@ -35,12 +39,15 @@ if exists('no_plugin_maps') || exists('no_mail_maps')
endif
" Flag messages as important/unimportant
-nnoremap <buffer> <LocalLeader>h
- \ :<C-U>call mail#FlagImportant()<CR>
+nnoremap <buffer> <LocalLeader>ih
+ \ :<C-U>SetImportance high<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>h'
-nnoremap <buffer> <LocalLeader>l
- \ :<C-U>call mail#FlagUnimportant()<CR>
+nnoremap <buffer> <LocalLeader>il
+ \ :<C-U>SetImportance low<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>l'
+nnoremap <buffer> <LocalLeader>in
+ \ :<C-U>SetImportance normal<CR>
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>n'
" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q