aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Cassou <damien@cassou.me>2019-05-13 16:58:51 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2019-05-29 08:15:18 +0300
commit8249a2403c859e618dc968a7cbc7ef9b88c0139c (patch)
tree84f7b9b0fa1234c997eb3c0bea035fabd0b5733d
parent4359e1b829f901f282189878e47e8c5f65a892d5 (diff)
Use fd when available instead of find
The patch make fd the default for searching for files in non-DVCS projects.
-rw-r--r--CHANGELOG.md2
-rw-r--r--doc/configuration.md4
-rw-r--r--projectile.el5
3 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce1dbd0..878f0ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/doc/configuration.md b/doc/configuration.md
index 49350a5..f357ecf 100644
--- a/doc/configuration.md
+++ b/doc/configuration.md
@@ -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
diff --git a/projectile.el b/projectile.el
index 8320699..c1783c7 100644
--- a/projectile.el
+++ b/projectile.el
@@ -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)