fzf Versions Save

:cherry_blossom: A command-line fuzzy finder

0.35.1

1 year 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

0.35.0

1 year 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 <<< ╸╸╸╸╸╸╸╸╸╸╸╸╸╸)
image
  • 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

0.34.0

1 year 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.

0.33.0

1 year 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
    

0.32.1

1 year 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'
    

0.32.0

1 year 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

0.31.0

1 year 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

0.30.0

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

0.29.0

2 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

0.28.0

2 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