diff options
-rw-r--r-- | plugin/substitute.vim | 7 |
1 files changed, 7 insertions, 0 deletions
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 <C-s> :set operatorfunc=DoSubstitution<cr>g@ + +function DoSubstitution(str) abort + exec printf(":'[,']s/%s/%s/g", @", @.) +endfunction |