Aquesta és una versió anterior. La versió actual és la 0.74.5. fzf 0.74.5 · Data de publicació:
Fitxers d’instal·lació 0.66.0
| Arquitectura | Tipus | Àmbit | Mida del fitxer | Baixa | SHA256 |
|---|---|---|---|---|---|
| 64 bits | ZIP → Portable | — | — | github.com | VirusTotal |
| ARM64 | ZIP → Portable | — | — | github.com | VirusTotal |
| ARM | ZIP → Portable | — | — | github.com | VirusTotal |
L’enllaç i l’SHA256 provenen del manifest comunitari del Gestor de paquets del Windows. Convé comparar el hash del fitxer baixat abans d’executar-lo.
Notes de la versió
Quick summary
This version introduces many new features centered around the new "raw" mode.
───────────┬───────┬─────────────────┬──────────────────────────────────────────────────
Type │Class │Name │Description
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Option │--raw │Enable raw mode by default
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Option │--gutter CHAR │Set the gutter column character
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Option │--gutter-raw CHAR│Set the gutter column character in raw mode
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
Enhancement│Option │--listen SOCKET │Added support for Unix domain sockets
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │toggle-raw │Toggle raw mode
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │enable-raw │Enable raw mode
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │disable-raw │Disable raw mode
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │up-match │Move up to the matching item
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │down-match │Move down to the matching item
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Action │best │Move to the matching item with the best score
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Color │nomatch │Color for non-matching items in raw mode
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Env Var│FZF_RAW │Matching status in raw mode (0, 1, or undefined)
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Env Var│FZF_DIRECTION │up or down depending on the layout
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
New │Env Var│FZF_SOCK │Path to the Unix domain socket fzf is listening on
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
Enhancement│Key │CTRL-N │down -> down-match
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
Enhancement│Key │CTRL-P │up -> up-match
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
Enhancement│Shell │CTRL-R binding │Toggle raw mode with ALT-R
───────────┼───────┼─────────────────┼──────────────────────────────────────────────────
Enhancement│Shell │CTRL-R binding │Opt-out with an empty FZF_CTRL_R_COMMAND
───────────┴───────┴─────────────────┴──────────────────────────────────────────────────
1. Introducing "raw" mode
This version introduces a new "raw" mode (named so because it shows the list
"unfiltered"). In raw mode, non-matching items stay in their original positions,
but appear dimmed. This allows you see surrounding items of a match and better
understand the context of it. You can enable raw mode by default with --raw,
but it's often more useful when toggled dynamically with the toggle-raw
action.
tree | fzf --reverse --bind alt-r:toggle-raw
While non-matching items are displayed in a dimmed color, they are treated just
like matching items, so you place the cursor on them and perform any action. If
you prefer to navigate only through matching items, use the down-match and
up-match actions, which are from now on bound to CTRL-N and CTRL-P
respectively, and also to ALT-DOWN and ALT-UP.
────────┬──────────┬─────────────
Key │Action │With
│ │--history
────────┼──────────┼─────────────
down │down │
────────┼──────────┼─────────────
up │up │
────────┼──────────┼─────────────
ctrl-j │down │
────────┼──────────┼─────────────
ctrl-k │up │
────────┼──────────┼─────────────
ctrl-n │down-match│next-history
────────┼──────────┼─────────────
ctrl-p │up-match │prev-history
────────┼──────────┼─────────────
alt-down│down-match│
────────┼──────────┼─────────────
alt-up │up-match │
────────┴──────────┴─────────────
Note
CTRL-N and CTRL-P are bound to next-history and prev-history when
--history option is enabled, so in that case, you'll need to manually bind
them, or use ALT-DOWN and ALT-UP instead.
Tip
up-match and down-match are equivalent to up and down when not in
raw mode, so you can safely bind them to up and arrow keys if you prefer.
fzf --bind up:up-match,down:down-match
Customizing the behavior
In raw mode, the input list is presented in its original order, unfiltered, and
your cursor will not move to the matching item automatically. Here are ways to
customize the behavior.
# When the result list is updated, move the cursor to the item with the best score
# (assuming sorting is not disabled)
fzf --raw --bind result:best
# Move to the first matching item in the original list
# - $FZF_RAW is set to 0 when raw mode is enabled and the current item is a non-match
# - $FZF_DIRECTION is set to either 'up' or 'down' depending on the layout direction
fzf --raw --bind 'result:first+transform:[[ $FZF_RAW = 0 ]] && echo $FZF_DIRECTION-match'
Customizing the look
Gutter
To make the mode visually distinct, the gutter column is rendered in a dashed
line using ▖ character. But you can customize it with the --gutter-raw CHAR
option.
# Use a thinner gutter instead of the default dashed line
fzf --bind alt-r:toggle-raw --gutter-raw ▎
Color and style of non-matching items
Non-matching items are displayed in a dimmed color by default, but you can
change it with the --color nomatch:... option.
fzf --raw --color nomatch:red
fzf --raw --color nomatch:red:dim
fzf --raw --color nomatch:red:dim:strikethrough
fzf --raw --color nomatch:red:dim:strikethrough:italic
For colored input, dimming alone may not be enough, and you may prefer to remove
colors entirely. For that case, a new special style attribute strip has been
added.
fd --color always | fzf --ansi --raw --color nomatch:dim:strip:strikethrough
Conditional actions for raw mode
You may want to perform different actions depending on whether the current item
is a match or not. For that, fzf now exports $FZF_RAW environment variable.
It's:
- Undefined if raw mode is disabled
- 1 if the current item is a match
- 0 otherwise
# Do not allow selecting non-matching items
fzf --raw --bind 'enter:transform:[[ ${FZF_RAW-1} = 1 ]] && echo accept || echo bell'
Leveraging raw mode in shell integration
The CTRL-R binding (command history) now lets you toggle raw mode with ALT-R.
2. Style changes
The screenshot on the right shows the updated gutter style:
This version includes a few minor updates to fzf's classic visual style:
- The gutter column is now narrower, rendered with the left-half block character (▌).
- Markers no longer use background colors.
- The --color base16 theme (alias: 16) has been updated for better compatibility with both dark and light themes.
3. --listen now supports Unix domain sockets
If an argument to --listen ends with .sock, fzf will listen on a Unix
domain socket at the specified path.
fzf --listen /tmp/fzf.sock --no-tmux
# GET
curl --unix-socket /tmp/fzf.sock http
# POST
curl --unix-socket /tmp/fzf.sock http -d up
Note that any existing file at the given path will be removed before creating
the socket, so avoid using an important file path.
4. Added options
--gutter CHAR
The gutter column can now be customized using --gutter CHAR and styled with
--color gutter:.... Examples:
# Right-aligned gutter
fzf --gutter '▐'
# Even thinner gutter
fzf --gutter '▎'
# Yellow checker pattern
fzf --gutter '▚' --color gutter:yellow
# Classic style
fzf --gutter ' ' --color gutter:reverse
--gutter-raw CHAR
As noted above, the --gutter-raw CHAR option was also added for customizing the gutter column in raw mode.
5. Added actions
The following actions were introduced to support working with raw mode:
───────────┬────────────────────────────────────────────────────────────────────────────────────────
Action │Description
───────────┼────────────────────────────────────────────────────────────────────────────────────────
toggle-raw │Toggle raw mode
───────────┼────────────────────────────────────────────────────────────────────────────────────────
enable-raw │Enable raw mode
───────────┼────────────────────────────────────────────────────────────────────────────────────────
disable-raw│Disable raw mode
───────────┼────────────────────────────────────────────────────────────────────────────────────────
up-match │Move up to the matching item; identical to up if raw mode is disabled
───────────┼────────────────────────────────────────────────────────────────────────────────────────
down-match │Move down to the matching item; identical to down if raw mode is disabled
───────────┼────────────────────────────────────────────────────────────────────────────────────────
best │Move to the matching item with the best score; identical to first if raw mode is
│disabled
───────────┴────────────────────────────────────────────────────────────────────────────────────────
6. Added environment variables
$FZF_DIRECTION
$FZF_DIRECTION is now exported to child processes, indicating the list direction of the current layout:
- up for the default layout
- down for reverse or reverse-list
This simplifies writing transform actions involving layout-dependent actions
like {up,down}-match, {up,down}-selected, and toggle+{up,down}.