I would like Projectile Mode to recognize other projects besides the default ones (GIT, Maven, etc.) The README.md describes how to customize project root files, however it doesn't explain how Projectile learns what files belong to a project once it has found a project root file. Therefore, what are the steps needed to configure a custom project root file?


Assuming you have projectile-indexing-method set to 'alien' (the default except for Windows), if the VCS isn't recognized, projectile will call projectile-generic-command, which is "find . -type f -print0" by default. If you want to take a closer look, projectile-get-ext-command is the function that decides to what to call.

I don't think there's any easy way to add a custom project type, but for an example of what you'd need to add, you can follow this commit that added support for fossil.

It's probably wrong for me to use the term 'project type' above since projectile has a projectile-project-type that determines a project type that is unrelated to the VCS used (django, python, rails,...). This information is only used for setting the test and compilation commands. As described above, it is the VCS (or lack of one) that determines how project files are collected.

  • Thank you. However, it seems that projectile-get-ext-command is meant for VCS files, albeit I think that it could be bent to other uses. Do you have any idea about how to do a similar thing with the kind of files listed in projectile-project-root-files? – Elena Dec 2 '14 at 0:13
  • Apparently, with VCS, Projectile will recognize only files under source control; but with other kind of projects, Projectile will take all the files inside the directory as project files. Right? – Elena Dec 2 '14 at 1:02
  • 1
    Yes, if there's not a recognized VCS (and projectile-indexing-method is 'alien'), projectile-generic-command will be used, which by default finds all files. For VCS projects, projectile will use projectile-VCS-command. This doesn't necessarily mean that the file is under source control. For example, projectile-git-command includes untracked files. – Kyle Meyer Dec 2 '14 at 2:09
  • 1
    If you want to treat a directory as a project, simply create an empty .projectile there. You can exclude files/directories you don't want by specifying it in .projectile file. See Ignoring Files. – Tu Do Dec 2 '14 at 4:48
  • @TuDo: I don't want to treat a directory as a project. I want Projectile to recognize as project files those files that are specified inside a special file (which is not .projectile). I know how to parse that special file, but I don't know how to pass the file list to Projectile. – Elena Dec 2 '14 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.