Skip to content

Instantly share code, notes, and snippets.

@nicot
Forked from bling/helm-fzf.el
Last active August 11, 2016 14:25
Show Gist options
  • Save nicot/24dfc382ae198194442f to your computer and use it in GitHub Desktop.
Save nicot/24dfc382ae198194442f to your computer and use it in GitHub Desktop.
(defvar helm-fzf-source
(helm-build-async-source "fzf"
:candidates-process 'helm-fzf--do-candidate-process
:nohighlight t
:requires-pattern 2
:candidate-number-limit 9999))
(defun helm-fzf--do-candidate-process ()
(let* ((cmd-args `("fzf" "-x" "-f" ,helm-pattern))
(proc (apply #'start-file-process "helm-fzf" nil cmd-args)))
(prog1 proc
(set-process-sentinel
proc
(lambda (process event)
(helm-process-deferred-sentinel-hook
process event (helm-default-directory)))))))
(defun helm-fzf ()
(interactive)
(let ((default-directory "~/"))
(find-file
(concat "~/" (helm :sources '(helm-fzf-source)
:buffer "*helm-fzf*")))))
@tieubao
Copy link

tieubao commented Jul 15, 2016

Hi, I'm trying to add it to Spacemacs. And I cannot found helm-build-async-source. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment