aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-08-22 13:10:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-22 13:10:37 +1200
commit320169d17759f10e84f836ad41b879f5fe8a7bd1 (patch)
treeb6ec04a62366389da9550faef4d7477ae2cbac22 /vim
parentTest for g:is_posix existence before purge (diff)
downloaddotfiles-320169d17759f10e84f836ad41b879f5fe8a7bd1.tar.gz
dotfiles-320169d17759f10e84f836ad41b879f5fe8a7bd1.zip
Add mail shortcut for flagging a message as urgent
Diffstat (limited to 'vim')
-rw-r--r--vim/after/ftplugin/mail.vim5
-rw-r--r--vim/autoload/mail.vim9
2 files changed, 13 insertions, 1 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index c3353cc7..4b6c827c 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -34,7 +34,10 @@ if exists('g:no_plugin_maps') || exists('g:no_mail_maps')
finish
endif
-" Flag a message as unimportant
+" Flag messages as important/unimportant
+nnoremap <buffer> <LocalLeader>h
+ \ <C-U>:call mail#FlagImportant()<CR>
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>h'
nnoremap <buffer> <LocalLeader>l
\ <C-U>:call mail#FlagUnimportant()<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>l'
diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim
index 6bec6e55..baff4bbf 100644
--- a/vim/autoload/mail.vim
+++ b/vim/autoload/mail.vim
@@ -1,3 +1,12 @@
+" Flag a message as important
+function! mail#FlagImportant() abort
+ call cursor(1, 1)
+ call search('^$')
+ -
+ call append(line('.'), 'X-Priority: 1')
+ call append(line('.'), 'Importance: High')
+endfunction
+
" Flag a message as unimportant
function! mail#FlagUnimportant() abort
call cursor(1, 1)