Skip to content

Instantly share code, notes, and snippets.

@mitechie
Created February 9, 2010 20:46
Show Gist options
  • Save mitechie/299640 to your computer and use it in GitHub Desktop.
Save mitechie/299640 to your computer and use it in GitHub Desktop.
function! PGrep(pattern, ...)
let pattern = a:pattern
if a:0 == 0
let ext = '*'
else
let ext = a:1
endif
let proj_path = system("echo $PROJ_PATH | tr -d '\n'")
let search_path = proj_path . "/**/*." . ext
:execute "vimgrep /" . pattern . "/j " search_path | :copen
endfunction
command! -nargs=* PGrep :call PGrep(<f-args>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment