From 80227fc6263ca864227de8b9d8d9f93f19ad173a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 1 Jan 2020 16:08:21 +1300 Subject: 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. --- vim/after/ftplugin/mail.vim | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'vim/after/ftplugin/mail.vim') 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(, ) let b:undo_ftplugin .= '|delcommand StrictQuote' +command -bar -buffer -nargs=1 SetImportance + \ call mail#importance#Set() +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 h - \ :call mail#FlagImportant() +nnoremap ih + \ :SetImportance high let b:undo_ftplugin .= '|nunmap h' -nnoremap l - \ :call mail#FlagUnimportant() +nnoremap il + \ :SetImportance low let b:undo_ftplugin .= '|nunmap l' +nnoremap in + \ :SetImportance normal +let b:undo_ftplugin .= '|nunmap n' " Quote operator nnoremap q -- cgit v1.2.3