Skip to content

Instantly share code, notes, and snippets.

@scajanus
Created April 7, 2015 05:38
Show Gist options
  • Select an option

  • Save scajanus/45ba6acbcb770bd9482b to your computer and use it in GitHub Desktop.

Select an option

Save scajanus/45ba6acbcb770bd9482b to your computer and use it in GitHub Desktop.
Add \%V to substitute pattern
com! -nargs=1 -bar -range Substitute <line1>,<line2>call Substitute(<q-args>)
function! Substitute(arg) range
let arglist = split(a:arg, '/')
echo arglist
exec a:firstline.",".a:lastline . 'substitute/\%V'.arglist[0].'\%V/'.arglist[1].'/'.arglist[2]
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment