Skip to content
Myr

Add instructions on how to use fd with fzf

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by GitHub · parent 8dde7c3 · Browse files · 1 file+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+23 added−0 removed

  • other:+23 added−0 removed

1 file+23 added−0 removed

modified:README.md+23 added
329 unmodified lines
330> fd -0 -e rs | xargs -0 wc -l331```332Here, the `-0` option tells *fd* to separate search results by the NULL character (instead of .333newlines) In the same way, the `-0` option of `xargs` tells it to read the input in this way .334335### Using fd with `fzf`336337You can use *fd* to generate input for the command-line fuzzy finder [fzf](https://github.com/junegunn/fzf):338``` bash339export FZF_DEFAULT_COMMAND='fd --type file'340export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"341```342343Then, you can type `vim <Ctrl-T>` on your terminal to open fzf and search through the fd-results.344345Alternatively, you might like to follow symbolic links and include hidden files (but exclude `.git` folders):346``` bash347export FZF_DEFAULT_COMMAND='fd --type file --follow --hidden --exclude .git'348```349350You can even use fd's colored output inside fzf by setting:351``` bash352export FZF_DEFAULT_COMMAND="fd --type file --color=always"353export FZF_DEFAULT_OPTS="--ansi"354```355356For more details, see the [Tips section](https://github.com/junegunn/fzf#tips) of the fzf README.