aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/mail.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-13 23:53:55 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-13 23:53:55 +1200
commit2e5f2b861b077193405684fe3c74de20f849ad5f (patch)
tree831f5f068dc234b9f98b5f60ae3ada338058fc7f /vim/after/ftplugin/mail.vim
parent368a2dbab586406520b6693dad46ea90e718c8b1 (diff)
downloaddotfiles-2e5f2b861b077193405684fe3c74de20f849ad5f.tar.gz
dotfiles-2e5f2b861b077193405684fe3c74de20f849ad5f.zip
Replace mail.vim quoting mappings
Diffstat (limited to 'vim/after/ftplugin/mail.vim')
-rw-r--r--vim/after/ftplugin/mail.vim16
1 files changed, 15 insertions, 1 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index fa1b9443..d22ec142 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -1,5 +1,5 @@
" Extra configuration for mail messages
-if &filetype !=# 'mail' || v:version < 700
+if &filetype !=# 'mail' || &compatible || v:version < 700
finish
endif
@@ -13,3 +13,17 @@ endif
" Add a space to the end of wrapped lines for format-flowed mail
setlocal formatoptions+=w
let b:undo_ftplugin .= '|setlocal formatoptions<'
+
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_mail_maps')
+ finish
+endif
+
+" The quote mapping in the stock plugin is a good idea, but I prefer it to
+" work as a motion rather than quoting to the end of the buffer
+nnoremap <buffer> <expr> <LocalLeader>q mail#Quote()
+nnoremap <buffer> <expr> <LocalLeader>qq mail#Quote().'_'
+xnoremap <buffer> <expr> <LocalLeader>q mail#Quote()
+let b:undo_ftplugin .= '|nunmap <LocalLeader>q'
+ \ . '|nunmap <LocalLeader>qq'
+ \ . '|xunmap <LocalLeader>q'