secret
anonymous / conner.vim
Created

  • Download Gist
conner.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
command! -nargs=* -range=% G <line1>,<line2>call MultiG(<f-args>)
fun! MultiG(...) range
let pattern = ""
let command = ""
for i in a:000
if i[0] == "-"
let pattern .= "\\(.*".strpart(i,1)."\\)\\@!"
elseif i[0] == "+"
let pattern .= "\\(.*".strpart(i,1)."\\)\\@="
else
let command = i
endif
endfor
exe a:firstline.",".a:lastline."g/".pattern."/".command
endfun

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.