diff options
Diffstat (limited to 'doc/modules/ROOT/pages')
| -rw-r--r-- | doc/modules/ROOT/pages/configuration.adoc | 22 | ||||
| -rw-r--r-- | doc/modules/ROOT/pages/projects.adoc | 19 |
2 files changed, 37 insertions, 4 deletions
diff --git a/doc/modules/ROOT/pages/configuration.adoc b/doc/modules/ROOT/pages/configuration.adoc index 1492633..2eada23 100644 --- a/doc/modules/ROOT/pages/configuration.adoc +++ b/doc/modules/ROOT/pages/configuration.adoc @@ -116,18 +116,32 @@ WARNING: If you ever decide to tweak those keep in mind that the command should the list of files **relative** to the project root and the resulting file list should be 0-delimited (as opposed to newline delimited). -For non-VCS projects Projectile will invoke whatever is in `projectile-generic-command`. By default that's: +For non-VCS projects Projectile will invoke whatever is in `projectile-generic-command`. The default chooses `fd` when it's installed and falls back to `find`: +[source,elisp] ---- -find . -type f -print0 +;; Effective default value of projectile-generic-command, picked at load time: +;; when fd is on PATH: +"fd . -0 --type f --color=never --strip-cwd-prefix" +;; otherwise: +"find . -type f | cut -c3- | tr '\\n' '\\0'" ---- TIP: It's a great idea to install https://github.com/sharkdp/fd[fd] which is much faster than `find`. - If `fd` is found, projectile will use it as a replacement for `find`. + If `fd` is found, projectile will use it as a replacement for `find` for non-VCS projects. + +WARNING: The `find` fallback does *not* exclude common build/cache directories + (`.git`, `node_modules`, `target`, `build`, …); a non-VCS project under `alien` + indexing on a host without `fd` will list everything. Either install `fd`, + switch to `hybrid` indexing so `projectile-globally-ignored-directories` + applies, or override `projectile-generic-command` with a tighter recipe. By default, `fd` is also used inside Git repositories (instead of `git ls-files`), because `git ls-files` has the limitation that it lists deleted files until the -deletions are staged. You can control this with `projectile-git-use-fd`: +deletions are staged. With `fd`, deleted files disappear from the listing +immediately; with `git ls-files`, Projectile post-filters the listing against +`git ls-files -zd` to hide deletions until they're staged. You can control this +with `projectile-git-use-fd`: [source,elisp] ---- diff --git a/doc/modules/ROOT/pages/projects.adoc b/doc/modules/ROOT/pages/projects.adoc index d08bae8..d14092b 100644 --- a/doc/modules/ROOT/pages/projects.adoc +++ b/doc/modules/ROOT/pages/projects.adoc @@ -976,6 +976,25 @@ globally ignoring files and directories. These take effect with `native` and (setq projectile-global-ignore-file-patterns '("\\.min\\.js$" "\\.map$")) ---- +==== Anchored vs anywhere directory ignores + +`projectile-globally-ignored-directories` distinguishes between *anchored* +entries (matched as a path prefix relative to the project root) and *anywhere* +entries (matched at any depth in the tree). The leading `*` is **not** a glob +character — it is the marker that promotes an entry from anchored to anywhere. + +[source,elisp] +---- +(setq projectile-globally-ignored-directories + '("tmp" ; only ignores ./tmp at the project root + "*node_modules" ; ignores any directory named node_modules at any depth + )) +---- + +The `*` prefix only matters for the `hybrid` post-processor; in `native` +indexing every entry is matched by directory basename at every traversal step +(so `tmp` and `*tmp` behave the same). `alien` ignores both forms entirely. + You can also _unignore_ specific files or directories that would otherwise be excluded. This is useful when your VCS ignores files that you still want Projectile to show: |
