- Added `zero` event that is triggered when there's no match
```sh
# Reload the candidate list when there's no match
echo $RANDOM | fzf --bind 'zero:reload(echo $RANDOM)+clear-query' --height 3
```
- New actions
- Added `track` action which makes fzf track the current item when the
search result is updated. If the user manually moves the cursor, or the
item is not in the updated search result, tracking is automatically
disabled. Tracking is useful when you want to see the surrounding items
by deleting the query string.
```sh
# Narrow down the list with a query, point to a command,
# and hit CTRL-T to see its surrounding commands.
export FZF_CTRL_R_OPTS="
--preview 'echo {}' --preview-window up:3:hidden:wrap
--bind 'ctrl-/:toggle-preview'
--bind 'ctrl-t:track+clear-query'
--bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
--color header:italic
--header 'Press CTRL-Y to copy command into clipboard'"
```
- Added `change-header(...)`
- Added `transform-header(...)`
- Added `toggle-track` action
- Fixed `--track` behavior when used with `--tac`
- However, using `--track` with `--tac` is not recommended. The resulting
behavior can be very confusing.
- Bug fixes and improvements
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=72
- Disable LTO
- Replace unused RPM_OPT_FLAGS
- Update to version 0.38.0:
* 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
OBS-URL: https://build.opensuse.org/request/show/1066389
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=66
- 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
- Update to 0.36.0:
- 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
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=64
- Update to 0.35.0:
* 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
OBS-URL: https://build.opensuse.org/request/show/1035310
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=60
- 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.
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=58
- Update to 0.33.0:
- 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
OBS-URL: https://build.opensuse.org/request/show/1001296
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=56
- Update to 0.32.0:
- 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
OBS-URL: https://build.opensuse.org/request/show/992624
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=54
- Update to 0.31.0:
- 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
OBS-URL: https://build.opensuse.org/request/show/990592
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=52
- update to 0.30.0:
* 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.
* Added rebind action for restoring bindings after unbind
* Switching between Ripgrep mode and fzf mode
* Bug fixes and improvements
OBS-URL: https://build.opensuse.org/request/show/984249
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=49
- Update to 0.29.0:
- 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 `|`
```sh
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`
OBS-URL: https://build.opensuse.org/request/show/942380
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=48
- 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
```vim
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
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=44
- Added unbind action. In the following Ripgrep launcher
example, you can use unbind(reload) to switch to fzf-only
filtering mode.
See https://github.com/junegunn/fzf/blob/master/ADVANCED.md#switching-to-fzf-only-search-mode
- 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 } }
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=40
- Added support for fixed header in preview window
# Display top 3 lines as the fixed header
fzf --preview 'bat --style=header,grid --color=always {}' --preview-window '~3'
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 --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
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=35
--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👎underline,hl+👎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
- Generate tags for vim documentation
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=31
- Update to 0.21.0:
- --height option is now available on Windows as well (@kelleyma49)
- Added --pointer and --marker options
- Added --keep-right option that keeps the right end of the line visible when it's too long
- Style changes
- --border will now print border with rounded corners around the finder instead of printing horizontal lines above and below it. The previous style is available via --border=horizontal
- Unicode spinner
- More keys and actions for --bind
- Added PowerShell script for downloading Windows binary
- Vim plugin: Built-in floating windows support
- bash: Various improvements in key bindings (CTRL-T, CTRL-R, ALT-C)
- CTRL-R will start with the current command-line as the initial query
- CTRL-R properly supports multi-line commands
- Fuzzy completion API changed
- Bug fixes
OBS-URL: https://build.opensuse.org/request/show/784648
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=15
- Update to 0.20.0:
- Customizable preview window color (preview-fg and preview-bg
for --color)
fzf --preview 'cat {}' \
--color 'fg:#bbccdd,fg+:#ddeeff,bg:#334455,preview-bg:#223344,border:#778899' \
--border --height 20 --layout reverse --info inline
Removed the immediate flicking of the screen on reload action.
: | fzf --bind 'change:reload:seq {q}' --phony
Added clear-query and clear-selection actions for --bind
- It is now possible to split a composite bind action over
multiple --bind expressions by prefixing the later ones with
+.
fzf --bind 'ctrl-a:up+up'
# Can be now written as
fzf --bind 'ctrl-a:up' --bind 'ctrl-a:+up'
# This is useful when you need to write special
# execute/reload form (i.e. `execute:...`)
# to avoid parse errors and add more actions to the same key
fzf --multi --bind 'ctrl-l:select-all+execute:less {+f}' --bind 'ctrl-l:+deselect-all'
- Fixed parse error of --bind expression where concatenated
execute/reload action contains + character.
fzf --multi --bind 'ctrl-l:select-all+execute(less {+f})+deselect-all'
- Fixed bugs of reload action
- Not triggered when there's no match even when the command
doesn't have any placeholder expressions
- Screen not properly cleared when --header-lines not filled
on reload
OBS-URL: https://build.opensuse.org/request/show/760825
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=13
- Update to 0.19.0
- Added --phony option which completely disables search functionality.
Useful when you want to use fzf only as a selector interface. See below.
- Added "reload" action for dynamically updating the input list without
restarting fzf. See https://github.com/junegunn/fzf/issues/1750 to
learn more about it.
- --multi now takes an optional integer argument which indicates the
maximum number of items that can be selected
- If a placeholder expression for --preview and execute action
(and the new reload action) contains f flag, it is replaced to
the path of a temporary file that holds the evaluated list.
This is useful when you multi-select a large number of items
and the length of the evaluated string may exceed ARG_MAX.
- deselect-all no longer deselects unmatched items. It is now
consistent with select-all and toggle-all in that it only affects
matched items.
- Due to the limitation of bash, fuzzy completion is enabled by
default for a fixed set of commands. A helper function for easily
setting up fuzzy completion for any command is now provided.
- Info line style can be changed by --info=STYLE
- Preview window border can be disabled by adding noborder to --preview-window.
- When you transform the input with --with-nth, the trailing white spaces are removed.
- ctrl-\, ctrl-], ctrl-^, and ctrl-/ can now be used with --bind
- See https://github.com/junegunn/fzf/milestone/15?closed=1 for more details
OBS-URL: https://build.opensuse.org/request/show/749132
OBS-URL: https://build.opensuse.org/package/show/utilities/fzf?expand=0&rev=11