Fork me on GitHub
#spacemacs
<
2019-08-26
>
Drew Verlee15:08:39

Is anyone successful able to ignore files when using a projectile project search? googling has given me answers that i feel i tried in the past and never worked.

practicalli-johnny21:08:15

@drewverlee Projectile should ignore your .gitignore patterns by default I can ignore files when searching with ripgrep using the -g! option followed by the filename pattern. So to find my-function but not in markdown files I can use -g!*.md my-function To search only in .clj files, then just use -g without the !

jumar08:08:29

@U05254DQM do you happen to know if there's a way to actually include files listed in .gitignore ?

practicalli-johnny08:08:48

If I read the docs correctly, then you should be able to create a .projectile file in the same directory as your .gitignore and starting each line of the pattern with a !

!/src/foo
!*.yml
I guess just copying your .gitignore file to .projectile and adding ! to the start of each line would be quickest way. https://projectile.readthedocs.io/en/latest/projects/#ignoring-files

practicalli-johnny08:08:08

Let me know if that works or you find a better way 😀

jumar09:08:58

Seems to work but I realized I'm actually more interested in including those files when doing fulltext search (`helm-project-do-ag` et al.)

practicalli-johnny21:08:09

I think silver searcher should also work, but not all search tools may work, or have different options

Drew Verlee21:08:13

Thanks, I'll give that a try