Skip to content

Releases: junegunn/fzf

0.38.0

15 Feb 14:27
0.38.0
352ea07
Compare
Choose a tag to compare
  • New actions
    • become(...) - Replace the current fzf process with the specified command using execve(2) system call.
      See https://github.com/junegunn/fzf#turning-into-a-different-process for more information.
      # Open selected files in Vim
      fzf --multi --bind 'enter:become(vim {+})'
      
      # Open the file in Vim and go to the line
      git grep --line-number . |
          fzf --delimiter : --nth 3.. --bind 'enter:become(vim {1} +{2})'
      • This action is not supported on Windows
    • show-preview
    • hide-preview
  • Bug fixes
    • --preview-window 0,hidden should not execute the preview command until toggle-preview action is triggered

0.37.0

24 Jan 13:18
0.37.0
2023012
Compare
Choose a tag to compare
  • Added a way to customize the separator of inline info
    fzf --info 'inline: ╱ ' --prompt '' --color prompt:bright-yellow
  • New event
    • focus - Triggered when the focus changes due to a vertical cursor
      movement or a search result update
      fzf --bind 'focus:transform-preview-label:echo [ {} ]' --preview 'cat {}'
      
      # Any action bound to the event runs synchronously and thus can make the interface sluggish
      # e.g. lolcat isn't one of the fastest programs, and every cursor movement in
      #      fzf will be noticeably affected by its execution time
      fzf --bind 'focus:transform-preview-label:echo [ {} ] | lolcat -f' --preview 'cat {}'
      
      # Beware not to introduce an infinite loop
      seq 10 | fzf --bind 'focus:up' --cycle
  • New actions
    • change-border-label
    • change-preview-label
    • transform-border-label
    • transform-preview-label
  • Bug fixes and improvements

0.36.0

16 Jan 16:51
0.36.0
2023011
Compare
Choose a tag to compare
  • Added --listen=HTTP_PORT option to start HTTP server. It allows external
    processes to send actions to perform via POST method.
    # Start HTTP server on port 6266
    fzf --listen 6266
    
    # Send actions to the server
    curl localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'
  • Added draggable scrollbar to the main search window and the preview window
    # Hide scrollbar
    fzf --no-scrollbar
    
    # Customize scrollbar
    fzf --scrollbar ┆ --color scrollbar:blue
  • New event
    • Added load event that is triggered when the input stream is complete
      and the initial processing of the list is complete.
      # Change the prompt to "loaded" when the input stream is complete
      (seq 10; sleep 1; seq 11 20) | fzf --prompt 'Loading> ' --bind 'load:change-prompt:Loaded> '
      
      # You can use it instead of 'start' event without `--sync` if asynchronous
      # trigger is not an issue.
      (seq 10; sleep 1; seq 11 20) | fzf --bind 'load:last'
  • New actions
    • Added pos(...) action to move the cursor to the numeric position
      • first and last are equivalent to pos(1) and pos(-1) respectively
      # Put the cursor on the 10th item
      seq 100 | fzf --sync --bind 'start:pos(10)'
      
      # Put the cursor on the 10th to last item
      seq 100 | fzf --sync --bind 'start:pos(-10)'
    • Added reload-sync(...) action which replaces the current list only after
      the reload process is complete. This is useful when the command takes
      a while to produce the initial output and you don't want fzf to run against
      an empty list while the command is running.
      # You can still filter and select entries from the initial list for 3 seconds
      seq 100 | fzf --bind 'load:reload-sync(sleep 3; seq 1000)+unbind(load)'
    • Added next-selected and prev-selected actions to move between selected
      items
      # `next-selected` will move the pointer to the next selected item below the current line
      # `prev-selected` will move the pointer to the previous selected item above the current line
      seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected
      
      # Both actions respect --layout option
      seq 10 | fzf --multi --bind ctrl-n:next-selected,ctrl-p:prev-selected --layout reverse
    • Added change-query(...) action that simply changes the query string to the
      given static string. This can be useful when used with --listen.
      curl localhost:6266 -d "change-query:$(date)"
    • Added transform-prompt(...) action for transforming the prompt string
      using an external command
      # Press space to change the prompt string using an external command
      # (only the first line of the output is taken)
      fzf --bind 'space:reload(ls),load:transform-prompt(printf "%s> " "$(date)")'
    • Added transform-query(...) action for transforming the query string using
      an external command
      # Press space to convert the query to uppercase letters
      fzf --bind 'space:transform-query(tr "[:lower:]" "[:upper:]" <<< {q})'
      
      # Bind it to 'change' event for automatic conversion
      fzf --bind 'change:transform-query(tr "[:lower:]" "[:upper:]" <<< {q})'
      
      # Can only type numbers
      fzf --bind 'change:transform-query(sed "s/[^0-9]//g" <<< {q})'
    • put action can optionally take an argument string
      # a will put 'alpha' on the prompt, ctrl-b will put 'bravo'
      fzf --bind 'a:put+put(lpha),ctrl-b:put(bravo)'
  • Added color name preview-label for --preview-label (defaults to label
    for --border-label)
  • Better support for (Windows) terminals where each box-drawing character
    takes 2 columns. Set RUNEWIDTH_EASTASIAN environment variable to 1.
    • On Vim, the variable will be automatically set if &ambiwidth is double
  • Behavior changes
    • fzf will always execute the preview command if the command template
      contains {q} even when it's empty. If you prefer the old behavior,
      you'll have to check if {q} is empty in your command.
      # This will show // even when the query is empty
      : | fzf --preview 'echo /{q}/'
      
      # But if you don't want it,
      : | fzf --preview '[ -n {q} ] || exit; echo /{q}/'
    • double-click will behave the same as enter unless otherwise specified,
      so you don't have to repeat the same action twice in --bind in most cases.
      # No need to bind 'double-click' to the same action
      fzf --bind 'enter:execute:less {}' # --bind 'double-click:execute:less {}'
    • If the color for separator is not specified, it will default to the
      color for border. Same holds true for scrollbar. This is to reduce
      the number of configuration items required to achieve a consistent color
      scheme.
    • If follow flag is specified in --preview-window option, fzf will
      automatically scroll to the bottom of the streaming preview output. But
      when the user manually scrolls the window, the following stops. With
      this version, fzf will resume following if the user scrolls the window
      to the bottom.
    • Default border style on Windows is changed to sharp because some
      Windows terminals are not capable of displaying rounded border
      characters correctly.
  • Minor bug fixes and improvements

0.35.1

18 Nov 11:45
0.35.1
b55f555
Compare
Choose a tag to compare
  • 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

11 Nov 16:00
0.35.0
d01ae55
Compare
Choose a tag to compare

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

28 Sep 14:30
0.34.0
04d0b02
Compare
Choose a tag to compare
  • 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

28 Aug 22:26
0.33.0
e03ac31
Compare
Choose a tag to compare
  • 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

08 Aug 15:01
0.32.1
4993d19
Compare
Choose a tag to compare
  • 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

02 Aug 12:59
0.32.0
f7e7259
Compare
Choose a tag to compare
  • 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

21 Jul 14:07
0.31.0
a0ef898
Compare
Choose a tag to compare
  • 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