Skip to content

Instantly share code, notes, and snippets.

@mitechie
Created February 9, 2010 22:18
Show Gist options
  • Save mitechie/299753 to your computer and use it in GitHub Desktop.
Save mitechie/299753 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'")
:exe 'cd '.proj_path
let search_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