感觉默认的helm-projectile-find-file (快捷键spc p f)搜索大项目比较慢,想更换成sharkdp的fd命令来搜索,fd已经在ubuntu上安装好,但是不知道怎么替换,有没有大神有指导方法啊?
;; Projectile...
(use-package projectile
:config
(cond
;; If fd exists, use it for git and generic projects. fd is a rust program
;; that is significantly faster than git ls-files or find, and it respects
;; .gitignore. This is recommended in the projectile docs.
((executable-find "fd")
(setq-default projectile-generic-command "fd . -0 --type f --color=never"))
((executable-find "rg")
(setq projectile-generic-command "rg -0 --files --follow --color=never --hidden"))))
projectile 默认就用 fd,可以 C-h v 确认 projectile-generic-command 的值是什么
多谢,解决了我的问题
多谢大神,确实spacemacs的develop分支projectile-generic-command的值就是用的fd了, 看来fd的速度还是不够快, 比起locate慢了很多.不过我有一点疑惑: 之前我没有装fd命令, spc p f也能用,装了fd命令后, spc p f跟没装的时候感觉速度差不多, 那没装fd的时候用的是啥命令?ls吗
C-h v 点进去看源码,C-h C-h 里都是特别便捷的文档,多用
(defcustom projectile-generic-command
(if (executable-find "fd")
"fd . -0 --type f --color=never"
"find . -type f -print0")
"Command used by projectile to get the files in a generic project."
:group 'projectile
:type 'string)
看了源码理解了, 多谢大神指点,又学会了一招