Created
February 9, 2010 22:18
-
-
Save mitechie/299753 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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