Fork me on GitHub
#spacemacs
<
2020-10-10
>
Karol W贸jcik07:10:37

How do you ignore directories using projectile so that SPC p f does not shows the resources directory? I don't want to put this directory in .gitignore for obvious reasons. Tried switching to 'native indexing method, adding .projectile file, specifying ignored directories via projectile-globally-ignored-directories seems to not work either. 馃槥

practicalli-johnny07:10:37

@karol.wojcik a .projectile file that contains ignore patters is what I would used. Reopen any open files from the project for the .projectile file to be loaded (or restart Emacs).

Karol W贸jcik07:10:03

Maybe that's the issue.

practicalli-johnny07:10:27

I also have repgrip installed. From a quick search there is mention of invalidating the cache (not sure how) Also mention of using a .ignore file with patterns to exclude

Karol W贸jcik07:10:10

@U05254DQM Actually there is no difference. Tried helm with the following .projectile content:

-resources
Regarding repgrip I got it installed as well and using .ignore file works perfect when using SPC / . I think that it's some kind of projectile issue which is not respecting the .projectile file in alien mode.

Karol W贸jcik07:10:49

To be frank I had it working for few searches when using native mode then it switched back to indexing "resources". 馃槥

Karol W贸jcik07:10:34

@U05254DQM When it comes to invalidating the cache you can do it by using SPC p I

practicalli-johnny07:10:04

If invalidating the cache doesn't work then I am out of ideas, sorry. Probably should raise a bug on Spacemacs

Karol W贸jcik07:10:38

Will do. Thank you very much though!

practicalli-johnny07:10:51

I'll see if I can replicate the issue later when I get to the computer.

Karol W贸jcik08:10:45

Got a workaround:

(progn
                     (make-local-variable 'projectile-globally-ignored-directories)
                     (add-to-list 'projectile-globally-ignored-directories "resources")
                     (set 'projectile-globally-ignored-directories projectile-globally-ignored-directories)

                     (defun f/invalidate-resources-cache ()
                       (interactive)
                       (projectile-purge-dir-from-cache "resources"))

                     (f/invalidate-resources-cache))

Karol W贸jcik08:10:01

As long as you don't invalidate cache of the project it will work 馃槃