aboutsummaryrefslogtreecommitdiff
path: root/plugin/substitute.vim
blob: 2c0831045a09e7acf2b45a97a52fcf82e67b08e3 (plain) (blame)
1
2
3
4
5
6
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