0.45.0
版本发布时间: 2024-01-01 14:41:32
junegunn/fzf最新发布版本:0.51.0(2024-05-01 13:37:01)
- Added
transform
action to conditionally perform a series of actions# Disallow selecting an empty line echo -e "1. Hello\n2. Goodbye\n\n3. Exit" | fzf --height '~100%' --reverse --header 'Select one' \ --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"' # Move cursor past the empty line echo -e "1. Hello\n2. Goodbye\n\n3. Exit" | fzf --height '~100%' --reverse --header 'Select one' \ --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"' \ --bind 'focus:transform:[[ -n {} ]] && exit; [[ {fzf:action} =~ up$ ]] && echo up || echo down' # A single key binding to toggle between modes fd --type file | fzf --prompt 'Files> ' \ --header 'CTRL-T: Switch between Files/Directories' \ --bind 'ctrl-t:transform:[[ ! {fzf:prompt} =~ Files ]] && echo "change-prompt(Files> )+reload(fd --type file)" || echo "change-prompt(Directories> )+reload(fd --type directory)"'
- Added placeholder expressions
-
{fzf:action}
- The name of the last action performed -
{fzf:prompt}
- Prompt string (including ANSI color codes) -
{fzf:query}
- Synonym for{q}
-
- Added support for negative height
# Terminal height minus 1, so you can still see the command line fzf --height=-1
- This handles a terminal resize better than
--height=$(($(tput lines) - 1))
- This handles a terminal resize better than
- Added
accept-or-print-query
action that acts likeaccept
but prints the current query when there's no match for the query# You can make CTRL-R paste the current query when there's no match export FZF_CTRL_R_OPTS='--bind enter:accept-or-print-query'
- Note that there are alternative ways to implement the same strategy
# 'become' is apparently more versatile but it's not available on Windows. export FZF_CTRL_R_OPTS='--bind "enter:become:if [ -z {} ]; then echo {q}; else echo {}; fi"' # Using the new 'transform' action export FZF_CTRL_R_OPTS='--bind "enter:transform:[ -z {} ] && echo print-query || echo accept"'
- Note that there are alternative ways to implement the same strategy
- Added
show-header
andhide-header
actions - Bug fixes
1、 fzf-0.45.0-darwin_amd64.zip 1.46MB
2、 fzf-0.45.0-darwin_arm64.zip 1.39MB
3、 fzf-0.45.0-freebsd_amd64.tar.gz 1.39MB
4、 fzf-0.45.0-linux_amd64.tar.gz 1.4MB
5、 fzf-0.45.0-linux_arm64.tar.gz 1.3MB
6、 fzf-0.45.0-linux_armv5.tar.gz 1.36MB
7、 fzf-0.45.0-linux_armv6.tar.gz 1.35MB
8、 fzf-0.45.0-linux_armv7.tar.gz 1.35MB
9、 fzf-0.45.0-linux_loong64.tar.gz 1.35MB
10、 fzf-0.45.0-linux_ppc64le.tar.gz 1.29MB
11、 fzf-0.45.0-linux_s390x.tar.gz 1.36MB
12、 fzf-0.45.0-openbsd_amd64.tar.gz 1.39MB
13、 fzf-0.45.0-windows_amd64.zip 1.59MB
14、 fzf-0.45.0-windows_arm64.zip 1.48MB
15、 fzf-0.45.0-windows_armv5.zip 1.57MB
16、 fzf-0.45.0-windows_armv6.zip 1.56MB
17、 fzf-0.45.0-windows_armv7.zip 1.55MB
18、 fzf_0.45.0_checksums.txt 1.59KB