Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Projectile search only part of the project

When using emacs Projectile and helm-projectile, I am used to search for text inside the whole project. However is there a way to search only part of the project?

Something like:

  • search inside a subfolder only
  • search while excluding a subfolder
like image 336
nha Avatar asked Oct 11 '16 16:10

nha


2 Answers

Yes you can exclude (sub) folders. Add a line in your .projectile:

-/sub/folder

So search inside a subfolder, I don't see something automatic. You could put project files in some subfolders (https://projectile.readthedocs.io/en/latest/configuration/#file-local-project-root-definitions) and switch projects.

like image 68
Ehvince Avatar answered Sep 20 '22 18:09

Ehvince


For now I am using rgrep, which prompts for a string and a directory to find.

I would be happy to hear about an equivalent solution using ag, and I should mention I haven't yet dug into the link from @goromlagche (https://github.com/ggreer/the_silver_searcher#emacs).

like image 30
nha Avatar answered Sep 21 '22 18:09

nha