From b4ae0dca7e39e8df56e0695e036de4c988fc7ecc Mon Sep 17 00:00:00 2001 From: David Peter Date: Tue, 2 Jan 2018 22:26:38 +0100 Subject: [PATCH] Add instructions on how to use fd with fzf --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index e701e3c..90ecfcf 100644 --- a/README.md +++ b/README.md @@ -331,3 +331,26 @@ If we want to run a command on all search results, we can pipe the output to `xa ``` Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of . newlines) In the same way, the `-0` option of `xargs` tells it to read the input in this way . + +### Using fd with `fzf` + +You can use *fd* to generate input for the command-line fuzzy finder [fzf](https://github.com/junegunn/fzf): +``` bash +export FZF_DEFAULT_COMMAND='fd --type file' +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +``` + +Then, you can type `vim ` on your terminal to open fzf and search through the fd-results. + +Alternatively, you might like to follow symbolic links and include hidden files (but exclude `.git` folders): +``` bash +export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden --exclude .git' +``` + +You can even use fd's colored output inside fzf by setting: +``` bash +export FZF_DEFAULT_COMMAND="fd --type file --color=always" +export FZF_DEFAULT_OPTS="--ansi" +``` + +For more details, see the [Tips section](https://github.com/junegunn/fzf#tips) of the fzf README.