feature some like projectile-find-file-in-known-projects
Projectile is pretty good project manager for me, I have been annoyed for switching between web project and backend project (api) recently.
It's so slow when I run projectile-find-file-in-known-projects. Probably because the projectile-known-projects have more than 50 projects.
So I tried to do something to deal with this condition, here is my plan:
- write a variable named 'projectile-related-project into .dir-locals.el, the variable may be string or list of string
- concatenate all the files in root and related project
extra: maybe define a function to edit the variable
(defun projectile-related-project-files (root)
"Projectile list all files in related projects with keyword ROOT."
(if (boundp 'projectile-related-project)
(cl-mapcan
(lambda (project)
(when (file-exists-p project)
(mapcar (lambda (file)
(expand-file-name file project))
(projectile-project-files project))))
(list root projectile-related-project))
(projectile-project-files root)
))
(defun projectile-find-file-in-related-projects ()
"Find file in related projects. The variable 'projectile-related-project can be defined in .dir-locals.el."
(interactive)
(let* ((root (projectile-acquire-root))
(files (projectile-related-project-files root)))
(find-file (projectile-completing-read "Find file in related projects: " files))))
So is this workable ?
I think that's an interesting idea and I'd welcome a PR on the subject. Alternatively we can have something like "project sets", that'd be essentially the same but can be global configuration (each set would be a list of related projects, perhaps with an optional name).