Projectile-grep, projectile-ag et al always execute the search in the current file's project.

What I want to do is to select the project from a completion list and get projectile to search that project instead of having to open a file in the project directory and running the search from there.

Does emacs or projectile itself have some way of doing that? The only way I can think of for now is to get the completion dialog to open a buffer onto a file from that project and run the projectile-grep command after that. That seems clumsy some how.

1 Answer 1


s-p p (where s-p represents whatever prefix key you have chosen) will allow you to choose a different project. It then prompts you to open a file from that project; you can just open whatever file is first in the list for speed. Then do the search.


  • I don't know how I've missed this for so long. Do the other project search systems to something similar?
    – vfclists
    Jun 22, 2021 at 1:17
  • 1
    Easy enough to miss one command in the midst of all the others. I only use Projectile, so I can’t compare it to alternatives.
    – db48x
    Jun 22, 2021 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.