From b42a2885d77c0cc84c90fe32507eefbc22423cd0 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 12 Aug 2022 12:36:24 -0600 Subject: Add substitute.vim --- plugin/substitute.vim | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugin/substitute.vim (limited to 'plugin') diff --git a/plugin/substitute.vim b/plugin/substitute.vim new file mode 100644 index 0000000..2c08310 --- /dev/null +++ b/plugin/substitute.vim @@ -0,0 +1,7 @@ +" C-s in normal mode will replace all the occurences of the last register with +" what was typed in the provided body. +noremap :set operatorfunc=DoSubstitutiong@ + +function DoSubstitution(str) abort + exec printf(":'[,']s/%s/%s/g", @", @.) +endfunction -- cgit