From 172fbc5f7e346c26c3cc64335de1e33347f79058 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 22:16:07 +1200 Subject: First version --- plugin/replace_operator.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugin/replace_operator.vim (limited to 'plugin') diff --git a/plugin/replace_operator.vim b/plugin/replace_operator.vim new file mode 100644 index 0000000..3e048d8 --- /dev/null +++ b/plugin/replace_operator.vim @@ -0,0 +1,22 @@ +" +" replace_operator.vim: Replace text selected with a motion with the +" contents of a register in a repeatable way. +" +" Author: Tom Ryder +" License: Same as Vim itself +" +if exists('g:loaded_replace_operator') || &compatible + finish +endif +if v:version < 700 + finish +endif +let g:loaded_replace_operator = 1 + +" Set up mapping +nnoremap + \ (ReplaceOperator) + \ :set operatorfunc=replace_operator#Operatorfuncg@ +xnoremap + \ (ReplaceOperator) + \ :call replace_operator#Operatorfunc(visualmode()) -- cgit v1.2.3