Skip to content

Commit

Permalink
Use fd when available instead of find
Browse files Browse the repository at this point in the history
The patch make fd the default for searching for files in non-DVCS
projects.
  • Loading branch information
DamienCassou authored and bbatsov committed May 29, 2019
1 parent 4359e1b commit 8249a24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* [#982](https://github.com/bbatsov/projectile/issues/982) Add heuristic for projectile-find-matching-test
* Support a list of functions for `related-files-fn` options and helper functions
* [#1405](https://github.com/bbatsov/projectile/pull/1405) Add Bloop Scala build server project detection
* [#1419](https://github.com/bbatsov/projectile/pull/1419) When possible, use [fd](https://github.com/sharkdp/fd) instead
of `find` to list the files of a non-VCS project. This should be much faster.

### Bugs fixed

Expand Down
4 changes: 2 additions & 2 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ find . -type f -print0

!!! Tip

It's a great idea to install [fd](https://github.com/sharkdp/fd) and use it as a replacement for both `git ls-files` (`fd` understands `.gitignore`) and `find`.
The magic command you'll need with it is something like `fd . -0`.
It's a great idea to install [fd](https://github.com/sharkdp/fd) which is much faster thant `find`.
If `fd` is found, projectile will use as a replacement for `find`.

## Sorting

Expand Down
5 changes: 4 additions & 1 deletion projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,10 @@ Set to nil to disable listing submodules contents."
:group 'projectile
:type 'string)

(defcustom projectile-generic-command "find . -type f -print0"
(defcustom projectile-generic-command
(if (executable-find "fd")
"fd . -0"
"find . -type f -print0")
"Command used by projectile to get the files in a generic project."
:group 'projectile
:type 'string)
Expand Down

0 comments on commit 8249a24

Please sign in to comment.