From cd5f438f5ecc65f05e92fb4d0d9ed33e3ef243e5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:05:12 +1200 Subject: Add mail quote maps for gitcommit and markdown --- vim/after/ftplugin/gitcommit.vim | 13 +++++++++++++ vim/after/ftplugin/markdown.vim | 13 +++++++++++++ 2 files changed, 26 insertions(+) (limited to 'vim/after') diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 8e365d98..4f57a407 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -7,3 +7,16 @@ endif setlocal comments+=n:> setlocal formatoptions+=coqr let b:undo_ftplugin .= '|setlocal comments< formatoptions<' + +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_gitcommit_maps') + finish +endif + +" Mail quote mappings +nnoremap q quote#Quote() +nnoremap qq quote#Quote().'_' +xnoremap q quote#Quote() +let b:undo_ftplugin .= '|nunmap q' + \ . '|nunmap qq' + \ . '|xunmap q' diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index 63f3f062..26b42849 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -20,3 +20,16 @@ if has('spell') endif endif + +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_markdown_maps') + finish +endif + +" Mail quote mappings +nnoremap q quote#Quote() +nnoremap qq quote#Quote().'_' +xnoremap q quote#Quote() +let b:undo_ftplugin .= '|nunmap q' + \ . '|nunmap qq' + \ . '|xunmap q' -- cgit v1.2.3