aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-14 20:05:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-14 20:05:12 +1200
commitcd5f438f5ecc65f05e92fb4d0d9ed33e3ef243e5 (patch)
tree917b7723d20f45fed42b97e267bef0f8c6129b39 /vim
parent3102cf30db49602baa4e4e665622d91ff339ea1e (diff)
downloaddotfiles-cd5f438f5ecc65f05e92fb4d0d9ed33e3ef243e5.tar.gz
dotfiles-cd5f438f5ecc65f05e92fb4d0d9ed33e3ef243e5.zip
Add mail quote maps for gitcommit and markdown
Diffstat (limited to 'vim')
-rw-r--r--vim/after/ftplugin/gitcommit.vim13
-rw-r--r--vim/after/ftplugin/markdown.vim13
2 files changed, 26 insertions, 0 deletions
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 <buffer> <expr> <LocalLeader>q quote#Quote()
+nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_'
+xnoremap <buffer> <expr> <LocalLeader>q quote#Quote()
+let b:undo_ftplugin .= '|nunmap <LocalLeader>q'
+ \ . '|nunmap <LocalLeader>qq'
+ \ . '|xunmap <LocalLeader>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 <buffer> <expr> <LocalLeader>q quote#Quote()
+nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_'
+xnoremap <buffer> <expr> <LocalLeader>q quote#Quote()
+let b:undo_ftplugin .= '|nunmap <LocalLeader>q'
+ \ . '|nunmap <LocalLeader>qq'
+ \ . '|xunmap <LocalLeader>q'