Fzf: Difference between revisions

From wikinotes
(Created page with " fzf serves two primary roles: * a generic fuzzy finder for files/dirs on the CLI * a shell library to extend aliases or methods to use a fuzzy finder I have only barel...")
 
No edit summary
Line 1: Line 1:
fzf is a tool that lets you fuzzy search lines piped to it on stdin.


fzf serves two primary roles:
= Documentation =
<blockquote>
{| class="wikitable"
|-
| github || https://github.com/junegunn/fzf
|-
|}
</blockquote><!-- Documentation -->


  * a generic fuzzy finder for files/dirs on the CLI
= Usage =
   * a shell library to extend aliases or methods to use a fuzzy finder
<blockquote>
== Keybindings ==
<blockquote>
Default Keybindings
<syntaxhighlight lang="yaml">
up/down  # go up/down entry
tab      # mark entry as selected (when multi-select active)
enter    # single-select and exit
# type   # search results
</syntaxhighlight>


You can set your own keybindings as well
<syntaxhighlight lang="bash">
export FZF_DEFAULT_OPTS='\
--bind \
ctrl-a:select-all,\
ctrl-d:deselect-all'
</syntaxhighlight>
</blockquote><!-- Keybindings -->


I have only barely started using fzf, currently my only
== CLI Usage ==
usage is a single alias that was in their reference docs.
<blockquote>
<syntaxhighlight lang="bash">
result=$(find . | fzf +m)    # choose single
results=($(find . | fzf -m))  # choose single or multiple
</syntaxhighlight>
</blockquote><!-- CLI Usage -->
</blockquote><!-- Usage -->

Revision as of 23:06, 21 July 2021

fzf is a tool that lets you fuzzy search lines piped to it on stdin.

Documentation

github https://github.com/junegunn/fzf

Usage

Keybindings

Default Keybindings

up/down  # go up/down entry
tab      # mark entry as selected (when multi-select active)
enter    # single-select and exit
# type   # search results

You can set your own keybindings as well

export FZF_DEFAULT_OPTS='\
--bind \
ctrl-a:select-all,\
ctrl-d:deselect-all'

CLI Usage

result=$(find . | fzf +m)     # choose single 
results=($(find . | fzf -m))  # choose single or multiple