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
Provenance
- Commit
c4df0dd- Tree
4a6e7ff- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
cd114c6
2 files changed+25 added−2 removed
modified:man/man1/fzf.1+23 added
1219 unmodified lines1220 \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 lines1333 e.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)'\fR1336 1337+.SS TRANSFORM ACTIONS1338+1339+Actions with \fBtransform-\fR prefix are used to transform the states of fzf1340+using the output of an external command. The output of these commands are1341+expected to be a single line of text.1342+1343+e.g.1344+ \fBfzf --bind 'focus:transform-header:file --brief {}'\fR1345+1346+\fBtransform(...)\fR action runs an external command that should print a series1347+of actions to be performed. The output should be in the same format as the1348+payload of HTTP POST request to the \fB--listen\fR server.1349+1350+e.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+ \fR1358+1359 .SS PREVIEW BINDING1360 1361 With \fBpreview(...)\fR action, you can specify multiple different preview1362 commands in addition to the default preview command given by \fB--preview\fR47 unmodified linesmodified:CHANGELOG.md+2 added-2 removed
5 unmodified lines6 - 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"'12 13 # 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 expressions1786 unmodified lines