0

When add a project with path /Users/me/folerd1/myproject, it works well. Use SPC p d to delete the added project myproject under folder1 path, then add it under another path /Users/me/folder2/myproject. It can be shown as /Users/me/folder2/myproject in the SPC p p list. However, if select the new myproject in the new folder. It opened in the old folder folder1 again.

So it seems it's using cache to fetch the same project name even under different path.

1 Answer 1

2

Managing the projectile cache

SPC p i will invalidate the project cache and remove any files changes since the cache was created or added to (when ever files are opened). Very useful when files are renamed.

SPC p D will read the projects on the projectile-project-search-path so should update the projects listed when using SPC p p

I use this code in the Doom config.el file to set the Projectile search path:

;; Define a project path to discover projects using SPC p D
;; https://docs.projectile.mx/projectile/usage.html
;; (setq projectile-project-search-path '("~/projects/" "~/work/" ("~/github" . 1)))
(setq projectile-project-search-path '(("~/projects" . 2) ("~/.config" . 1)))

In this example the ~/projects directory and its sub-directories are searched, along with the .config directory

Disable the cache

If the projectile cache causes more challenges that value it provides, then disable the cache in the Doom config.el file

;; Disable projectile cache - saves requirement to invalidate cache when moving files
;; (setq projectile-enable-caching nil)

Hope this helps.

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.