projectile怎么关闭自动添加文件夹到已知项目列表。

我好像已经设置了,(setq projectile-auto-discover nil), 但是它还是会装有.git目录自动添加到项目列表。

可以设置 projectile-ignored-project-function, 我的配置供参考

 (setq projectile-switch-project-action #'projectile-find-file-dwim
        projectile-completion-system 'ivy
        ;; projectile-enable-caching t
        projectile-project-root-files-functions #'(projectile-root-top-down
                                                   projectile-root-top-down-recurring
                                                   projectile-root-bottom-up
                                                   projectile-root-local)
        projectile-ignored-project-function (lambda (project-root)
                                              (cl-dolist (deny '("\\.git" "\\.rustup" "\\.cargo" "go/pkg"))
                                                (when (string-match-p deny project-root)
                                                  (cl-return t)))))

谢谢,呵呵,我原还以为可以设置呢。

我找到了这个变量好像可以设置。

projectile-track-known-projects-automatically is a variable defined in ‘projectile.el’.
Its value is t

Documentation:
Controls whether Projectile will automatically register known projects.

When set to nil you’ll have always add projects explicitly with
‘projectile-add-known-project’.