Skip to content

Instantly share code, notes, and snippets.

@TaurusOlson
Created May 9, 2011 11:55
Show Gist options
  • Save TaurusOlson/962401 to your computer and use it in GitHub Desktop.
Save TaurusOlson/962401 to your computer and use it in GitHub Desktop.
An alternative vimgrep
function! VG(pattern)
silent exe "vimgrep /" . a:pattern . "/ %"
silent exe "copen"
silent exe "setlocal cul"
endfunction
function! VGAdd(pattern)
silent exe "vimgrepadd /" . a:pattern . "/ %"
silent exe "copen"
silent exe "setlocal cul"
endfunction
command! -nargs=+ VG :call VG(<q-args>)
map <leader>g :VG
command! -nargs=+ VGAdd :call VGAdd(<q-args>)
map <leader>a :VGAdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment