Skip to content
Myr

Add TRANSFORM ACTIONS section to man page

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent cd114c6 · Browse files · 2 files+25 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+25 added−2 removed

  • other:+25 added−2 removed

2 files+25 added−2 removed

modified:man/man1/fzf.1+23 added
1219 unmodified lines
1220 \fBtoggle-sort\fR1221 \fBtoggle-track\fR1222 \fBtoggle+up\fR \fIbtab (shift-tab)\fR1223 \fBtrack\fR (track the current item; automatically disabled if focus changes)1224 \fBtransform(...)\fR (transform states using the output of an external command)1225 \fBtransform-border-label(...)\fR (transform border label using an external command)1226 \fBtransform-header(...)\fR (transform header using an external command)1227 \fBtransform-preview-label(...)\fR (transform preview label using an external command)1228 \fBtransform-prompt(...)\fR (transform prompt string using an external command)
104 unmodified lines
1333e.g.1334 \fB# You can still filter and select entries from the initial list for 3 seconds1335 seq 100 | fzf --bind 'load:reload-sync(sleep 3; seq 1000)+unbind(load)'\fR13361337.SS TRANSFORM ACTIONS13381339Actions with \fBtransform-\fR prefix are used to transform the states of fzf1340using the output of an external command. The output of these commands are1341expected to be a single line of text.13421343e.g.1344 \fBfzf --bind 'focus:transform-header:file --brief {}'\fR13451346\fBtransform(...)\fR action runs an external command that should print a series1347of actions to be performed. The output should be in the same format as the1348payload of HTTP POST request to the \fB--listen\fR server.13491350e.g.1351 \fB# Disallow selecting an empty line1352 echo -e "1. Hello\\n2. Goodbye\\n\\n3. Exit" |1353 fzf --height '~100%' --reverse --header 'Select one' \\1354 --bind 'enter:transform:[[ -n {} ]] &&1355 echo accept ||1356 echo "change-header:Invalid selection"'1357 \fR13581359.SS PREVIEW BINDING13601361With \fBpreview(...)\fR action, you can specify multiple different preview1362commands in addition to the default preview command given by \fB--preview\fR
47 unmodified lines
modified:CHANGELOG.md+2 added-2 removed
5 unmodified lines
6- Added `transform` action to conditionally perform a series of actions7 ```sh8 # Disallow selecting an empty line9 echo -e "1. Hello\n2. Goodbye\n\n3. Exit" |10 fzf --reverse --header 'Select one' \10 fzf --height '~100%' --reverse --header 'Select one' \11 --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"'1213 # Move cursor past the empty line14 echo -e "1. Hello\n2. Goodbye\n\n3. Exit" |15 fzf --reverse --header 'Select one' \15 fzf --height '~100%' --reverse --header 'Select one' \16 --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"' \17 --bind 'focus:transform:[[ -n {} ]] && exit; [[ {fzf:action} =~ up$ ]] && echo up || echo down'18 ```19- Added placeholder expressions
1786 unmodified lines