fzf

A command-line fuzzy finder

MIT License

Downloads
18.7K
Stars
59.9K
Committers
275

Bot releases are hidden (Show)

fzf - 0.35.1

Published by junegunn almost 2 years ago

  • Fixed a bug where fzf with --tiebreak=chunk crashes on inverse match query
  • Fixed a bug where clicking above fzf would paste escape sequences
fzf - 0.35.0

Published by junegunn almost 2 years ago

Putting it all together..

# With http://metaphorpsum.com/ and https://github.com/busyloop/lolcat
label1=$(curl -s http://metaphorpsum.com/sentences/1 | lolcat -f)
label2=$(curl -s http://metaphorpsum.com/sentences/1 | lolcat -f)

# Using colors from 'cosmic_latte'
# (See https://github.com/junegunn/fzf/blob/master/ADVANCED.md#generating-fzf-color-theme-from-vim-color-schemes)
fzf --border=double \
    --border-label="${label1} ╠" --border-label-pos=-3,bottom \
    --color=bg+:#2b3740,bg:#202a31,spinner:#7d9761,hl:#898f9e,fg:#abb0c0,header:#898f9e,info:#459d90 \
    --color=pointer:#7d9761,marker:#7d9761,fg+:#abb0c0,prompt:#7d9761,hl+:#7d9761,border:#2b3740,label:#2b3740 \
    --preview='lolcat -f {}' --preview-label="${label2} ┏" \
    --preview-window=top,border-bold \
    --separator=$(lolcat -f -F 1.4 <<< ╸╸╸╸╸╸╸╸╸╸╸╸╸╸)

  • Added start event that is triggered only once when fzf finder starts. Since fzf consumes the input stream asynchronously, the input list is not available unless you use --sync.
    seq 100 | fzf --multi --sync --bind 'start:last+select-all+preview(echo welcome)'
    
  • Added --border-label and --border-label-pos for putting label on the border
    # ANSI color codes are supported
    # (with https://github.com/busyloop/lolcat)
    label=$(curl -s http://metaphorpsum.com/sentences/1 | lolcat -f)
    
    # Border label at the center
    fzf --height=10 --border --border-label="$label" --color=label:italic:black
    
    # Left-aligned (positive integer)
    fzf --height=10 --border --border-label="$label" --border-label-pos=3 --color=label:italic:black
    
    # Right-aligned (negative integer) on the bottom line (:bottom)
    fzf --height=10 --border --border-label="$label" --border-label-pos=-3:bottom --color=label:italic:black
    
  • Also added --preview-label and --preview-label-pos for the border of the preview window
    fzf --preview 'cat {}' --border --preview-label=' Preview ' --preview-label-pos=2
    
  • Info panel (match counter) will be followed by a horizontal separator by default
    • Use --no-separator or --separator='' to hide the separator
    • You can specify an arbitrary string that is repeated to form the horizontal separator. e.g. --separator=╸
    • The color of the separator can be customized via --color=separator:...
    • ANSI color codes are also supported
    fzf --separator=╸ --color=separator:green
    fzf --separator=$(lolcat -f -F 1.4 <<< ▁▁▂▃▄▅▆▆▅▄▃▂▁▁) --info=inline
    
  • Added --border=bold and --border=double along with --preview-window=border-bold and --preview-window=border-double
fzf - 0.34.0

Published by junegunn about 2 years ago

  • Added support for adaptive --height. If the --height value is prefixed
    with ~, fzf will automatically determine the height in the range according
    to the input size.
    seq 1 | fzf --height ~70% --border --padding 1 --margin 1
    seq 10 | fzf --height ~70% --border --padding 1 --margin 1
    seq 100 | fzf --height ~70% --border --padding 1 --margin 1
    
    • There are a few limitations
      • Not compatible with percent top/bottom margin/padding
        # This is not allowed (top/bottom margin in percent value)
        fzf --height ~50% --border --margin 5%,10%
        
        # This is allowed (top/bottom margin in fixed value)
        fzf --height ~50% --border --margin 2,10%
        
      • fzf will not start until it can determine the right height for the input
        # fzf will open immediately
        (sleep 2; seq 10) | fzf --height 50%
        
        # fzf will open after 2 seconds
        (sleep 2; seq 10) | fzf --height ~50%
        (sleep 2; seq 1000) | fzf --height ~50%
        
  • Fixed tcell renderer used to render full-screen fzf on Windows
  • --no-clear is deprecated. Use reload action instead.
fzf - 0.33.0

Published by junegunn about 2 years ago

  • Added --scheme=[default|path|history] option to choose scoring scheme
    • (Experimental)
    • We updated the scoring algorithm in 0.32.0, however we have learned that
      this new scheme (default) is not always giving the optimal result
    • path: Additional bonus point is only given to the the characters after
      path separator. You might want to choose this scheme if you have many
      files with spaces in their paths.
    • history: No additional bonus points are given so that we give more
      weight to the chronological ordering. This is equivalent to the scoring
      scheme before 0.32.0. This also sets --tiebreak=index.
  • ANSI color sequences with colon delimiters are now supported.
    printf "\e[38;5;208mOption 1\e[m\nOption 2" | fzf --ansi
    printf "\e[38:5:208mOption 1\e[m\nOption 2" | fzf --ansi
    
  • Support border-{up,down} as the synonyms for border-{top,bottom} in
    --preview-window
  • Added support for ANSI strikethrough
    printf "\e[9mdeleted" | fzf --ansi
    fzf --color fg+:strikethrough
    
fzf - 0.32.1

Published by junegunn about 2 years ago

  • Fixed incorrect ordering of --tiebreak=chunk
  • fzf-tmux will show fzf border instead of tmux popup border (requires tmux 3.3)
    fzf-tmux -p70%
    fzf-tmux -p70% --color=border:bright-red
    fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal --padding 1,5 --margin 1,0
    fzf-tmux -p70%,100% --color=border:bright-green --border=vertical
    
    # Key bindings (CTRL-T, CTRL-R, ALT-C) will use these options
    export FZF_TMUX_OPTS='-p100%,60% --color=border:green --border=horizontal --padding 1,5 --margin 1,0'
    
fzf - 0.32.0

Published by junegunn about 2 years ago

  • Updated the scoring algorithm
    • Different bonus points to different categories of word boundaries
      (listed higher to lower bonus point)
      • Word after whitespace characters or beginning of the string
      • Word after common delimiter characters (/,:;|)
      • Word after other non-word characters
      # foo/bar.sh` is preferred over `foo-bar.sh` on `bar`
      fzf --query=bar --height=4 << EOF
      foo-bar.sh
      foo/bar.sh
      EOF
      
  • Added a new tiebreak chunk
    • Favors the line with shorter matched chunk. A chunk is a set of
      consecutive non-whitespace characters.
    • Unlike the default length, this scheme works well with tabular input
      # length prefers item #1, because the whole line is shorter,
      # chunk prefers item #2, because the matched chunk ("foo") is shorter
      fzf --height=6 --header-lines=2 --tiebreak=chunk --reverse --query=fo << "EOF"
      N | Field1 | Field2 | Field3
      - | ------ | ------ | ------
      1 | hello  | foobar | baz
      2 | world  | foo    | bazbaz
      EOF
      
    • If the input does not contain any spaces, chunk is equivalent to
      length. But we're not going to set it as the default because it is
      computationally more expensive.
  • Bug fixes and improvements
fzf - 0.31.0

Published by junegunn about 2 years ago

  • Added support for an alternative preview window layout that is activated
    when the size of the preview window is smaller than a certain threshold.
    # If the width of the preview window is smaller than 50 columns,
    # it will be displayed above the search window.
    fzf --preview 'cat {}' --preview-window 'right,50%,border-left,<50(up,30%,border-bottom)'
    
    # Or you can just hide it like so
    fzf --preview 'cat {}' --preview-window '<50(hidden)'
    
  • fzf now uses SGR mouse mode to properly support mouse on larger terminals
  • You can now use characters that do not satisfy unicode.IsGraphic constraint
    for --marker, --pointer, and --ellipsis. Allows Nerd Fonts and stuff.
    Use at your own risk.
  • Bug fixes and improvements
  • Shell extension
    • kill completion now requires trigger sequence (**) for consistency
fzf - 0.30.0

Published by junegunn over 2 years ago

  • Fixed cursor flickering over the screen by hiding it during rendering
  • Added --ellipsis option. You can take advantage of it to make fzf
    effectively search non-visible parts of the item.
    # Search against hidden line numbers on the far right
    nl /usr/share/dict/words                  |
      awk '{printf "%s%1000s\n", $2, $1}'     |
      fzf --nth=-1 --no-hscroll --ellipsis='' |
      awk '{print $2}'
    
  • Added rebind action for restoring bindings after unbind
  • Bug fixes and improvements
fzf - 0.29.0

Published by junegunn almost 3 years ago

  • Added change-preview(...) action to change the --preview command
    • cf. preview(...) is a one-off action that doesn't change the default
      preview command
  • Added change-preview-window(...) action
    • You can rotate through the different options separated by |
      fzf --preview 'cat {}' --preview-window right,40% \
          --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-top|hidden|)'
      
  • Fixed rendering of the prompt line when overflow occurs with --info=inline
fzf - 0.28.0

Published by junegunn almost 3 years ago

  • Added --header-first option to print header before the prompt line
    fzf --header $'Welcome to fzf\n▔▔▔▔▔▔▔▔▔▔▔▔▔▔' --reverse --height 30% --border --header-first
    
  • Added --scroll-off=LINES option (similar to scrolloff option of Vim)
    • You can set it to a very large number so that the cursor stays in the
      middle of the screen while scrolling
      fzf --scroll-off=5
      fzf --scroll-off=999
      
  • Fixed bug where preview window is not updated on reload (#2644)
  • fzf on Windows will also use $SHELL to execute external programs
    • See #2638 and #2647
    • Thanks to @rashil2000, @vovcacik, and @janlazo
fzf - 0.27.3

Published by junegunn about 3 years ago

  • Preview window is hidden by default when there are preview bindings but --preview command is not given
  • Fixed bug where {n} is not properly reset on reload
  • Fixed bug where spinner is not displayed on reload
  • Enhancements in tcell renderer for Windows (#2616)
  • Vim plugin
    • sinklist is added as a synonym to sink* so that it's easier to add a function to a spec dictionary
      let spec = { 'source': 'ls', 'options': ['--multi', '--preview', 'cat {}'] }
      function spec.sinklist(matches)
        echom string(a:matches)
      endfunction
      
      call fzf#run(fzf#wrap(spec))
      
    • Vim 7 compatibility
fzf - 0.27.2

Published by junegunn over 3 years ago

  • 16 base ANSI colors can be specified by their names
    fzf --color fg:3,fg+:11
    fzf --color fg:yellow,fg+:bright-yellow
    
  • Fix bug where --read0 not properly displaying long lines
fzf - 0.27.1

Published by junegunn over 3 years ago

  • Added unbind action. In the following Ripgrep launcher example, you can use unbind(reload) to switch to fzf-only filtering mode.
  • Vim plugin
    • Vim plugin will stop immediately even when the source command hasn't finished
      " fzf will read the stream file while allowing other processes to append to it
      call fzf#run(fzf#wrap({'source': 'cat /dev/null > /tmp/stream; tail -f /tmp/stream'}))
      
    • It is now possible to open popup window relative to the currrent window
      let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'relative': v:true, 'yoffset': 1.0 } }
      
fzf - 0.27.0

Published by junegunn over 3 years ago

  • More border options for --preview-window
    fzf --preview 'cat {}' --preview-window border-left
    fzf --preview 'cat {}' --preview-window border-left --border horizontal
    fzf --preview 'cat {}' --preview-window top:border-bottom
    fzf --preview 'cat {}' --preview-window top:border-horizontal
    
  • Automatically set /dev/tty as STDIN on execute action
    # Redirect /dev/tty to suppress "Vim: Warning: Input is not from a terminal"
    # ls | fzf --bind "enter:execute(vim {} < /dev/tty)"
    
    # "< /dev/tty" part is no longer needed
    ls | fzf --bind "enter:execute(vim {})"
    
  • Bug fixes and improvements
  • Signed and notarized macOS binaries
    (Huge thanks to BACKERS.md!)
fzf - 0.26.0

Published by junegunn over 3 years ago

  • Added support for fixed header in preview window
    # Display top 3 lines as the fixed header
    fzf --preview 'bat --style=full --color=always {}' --preview-window '~3'
    
    # Works well with the streaming preview
    fzf --preview-window 'follow:~2' --preview 'for i in $(seq 100000); do
      # Clear preview content every 300 lines and print header
      (( i % 300 == 1 )) && echo -e "\x1b[2J$i ~ $((i + 300))" && echo '---'
      echo "$i"
      sleep 0.01
    done'
    
  • More advanced preview offset expression to better support the fixed header
    # Preview with bat, matching line in the middle of the window below
    # the fixed header of the top 3 lines
    #
    #   ~3    Top 3 lines as the fixed header
    #   +{2}  Base scroll offset extracted from the second field
    #   +3    Extra offset to compensate for the 3-line header
    #   /2    Put in the middle of the preview area
    #
    git grep --line-number '' |
      fzf --layout reverse --delimiter : \
          --preview 'bat --style=full --color=always --highlight-line {2} {1}' \
          --preview-window '~3:+{2}+3/2'
    
  • Added select and deselect action for unconditionally selecting or
    deselecting a single item in --multi mode. Complements toggle action.
  • Sigificant performance improvement in ANSI code processing
  • Bug fixes and improvements
  • Built with Go 1.16
fzf - 0.25.1

Published by junegunn over 3 years ago

  • Added close action
    • Close preview window if open, abort fzf otherwise
  • Bug fixes and improvements
fzf - 0.25.0

Published by junegunn almost 4 years ago

  • Text attributes set in --color are not reset when fzf sees another
    --color option for the same element. This allows you to put custom text
    attributes in your $FZF_DEFAULT_OPTS and still have those attributes
    even when you override the colors.

    # Default colors and attributes
    fzf
    
    # Apply custom text attributes
    export FZF_DEFAULT_OPTS='--color fg+:italic,hl:-1:underline,hl+:-1:reverse:underline'
    
    fzf
    
    # Different colors but you still have the attributes
    fzf --color hl:176,hl+:177
    
    # Write "regular" if you want to clear the attributes
    fzf --color hl:176:regular,hl+:177:regular
    
  • Renamed --phony to --disabled

  • You can dynamically enable and disable the search functionality using the
    new enable-search, disable-search, and toggle-search actions

  • You can assign a different color to the query string for when search is disabled

    fzf --color query:#ffffff,disabled:#999999 --bind space:toggle-search
    
  • Added last action to move the cursor to the last match

    • The opposite action top is renamed to first, but top is still
      recognized as a synonym for backward compatibility
  • Added preview-top and preview-bottom actions

  • Extended support for alt key chords: alt with any case-sensitive single character

    fzf --bind alt-,:first,alt-.:last
    
fzf - 0.24.4

Published by junegunn almost 4 years ago

  • Added --preview-window option follow
    # Preview window will automatically scroll to the bottom
    fzf --preview-window follow --preview 'for i in $(seq 100000); do
      echo "$i"
      sleep 0.01
      (( i % 300 == 0 )) && printf "\033[2J"
    done'
    
  • Added change-prompt action
    fzf --prompt 'foo> ' --bind $'a:change-prompt:\x1b[31mbar> '
    
  • Bug fixes and improvements
fzf - 0.24.3

Published by junegunn almost 4 years ago

  • Added --padding option
    fzf --margin 5% --padding 5% --border --preview 'cat {}' \
        --color bg:#222222,preview-bg:#333333
    
fzf - 0.24.2

Published by junegunn almost 4 years ago

  • Bug fixes and improvements
Package Rankings
Top 1.74% on Alpine-edge
Top 3.86% on Alpine-v3.9
Top 5.62% on Alpine-v3.14
Top 5.1% on Alpine-v3.13
Top 5.59% on Alpine-v3.12
Top 0.25% on Alpine-v3.18
Top 1.69% on Formulae.brew.sh
Top 5.89% on Alpine-v3.11
Top 6.52% on Alpine-v3.8
Top 3.97% on Alpine-v3.10
Top 3.22% on Alpine-v3.16
Top 6.61% on Alpine-v3.15
Top 7.06% on Alpine-v3.17
Top 14.77% on Spack.io
Top 18.1% on Conda-forge.org
Top 31.64% on Pypi.org