helm-fd - 用 fd 结合上 helm 查找文件

fd 使用起来比 find 更为轻松,默认就能忽略 .git

刚刚写一个简单的 Helm 界面:

19

(defun helm-fd ()
  (interactive)
  (helm :sources
        (helm-build-async-source "fd"
          :header-name (lambda (name)
                         (format "%s in [%s]" name (helm-default-directory)))
          :candidates-process
          (lambda ()
            (let ((process-connection-type nil))
              (let ((proc (apply #'start-process
                                 "helm-fd" helm-buffer
                                 "fd" (split-string helm-pattern))))
                (set-process-sentinel proc #'ignore)
                proc)))
          :persistent-action 'helm-ff-kill-or-find-buffer-fname    
          :action 'helm-type-file-actions
          :help-message 'helm-generic-file-help-message
          :keymap helm-find-map
          :candidate-number-limit 9999)
        :buffer "*helm fd*"))

话说回來你写过个 helm-fuzzy-find,好久沒更新过。 不过用的后端 ff 用 C 写的,安装比較方便,体积只有 14K 我現在还有在用。

那会流行用 Go 写的工具,Rust 出現就換 Rust 写的,不過我現在嫌麻煩只用 C 了。

rust的runtime大,启动慢,写小程序体验还不一定有C好