aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/quote.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-14 19:42:02 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-14 19:42:02 +1200
commit2985baeea1e41f87eba6c695bed848493d3ac9c8 (patch)
tree6f8ef93f290c61c946008c3fe8b06e2d9cbb7f97 /vim/autoload/quote.vim
parentRemove bell settings from .gvimrc (diff)
downloaddotfiles-2985baeea1e41f87eba6c695bed848493d3ac9c8.tar.gz
dotfiles-2985baeea1e41f87eba6c695bed848493d3ac9c8.zip
Change mail quoting to generic autoload function
I intend to use it elsewhere.
Diffstat (limited to 'vim/autoload/quote.vim')
-rw-r--r--vim/autoload/quote.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim
new file mode 100644
index 00000000..92de5035
--- /dev/null
+++ b/vim/autoload/quote.vim
@@ -0,0 +1,11 @@
+" Quote lines in mail and mail-based formats: Markdown, Git commits, etc
+function! quote#Quote() abort
+ set operatorfunc=quote#QuoteOpfunc
+ return 'g@'
+endfunction
+function! quote#QuoteOpfunc(type) abort
+ for l:li in range(line('''['), line(''']'))
+ let l:line = getline(l:li)
+ call setline(l:li, '>'.l:line)
+ endfor
+endfunction