diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-01-23 16:22:25 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-01-23 16:38:24 +0900 |
commit | 284d77fe2e41ec69fcc7ca7162bcf9b65b1641be (patch) | |
tree | 0dbac33153f7b7b611bc41451e09fdeeb4af4410 /man | |
parent | 826178f1e2927ecef8b7699ef1269ba060a0a029 (diff) |
Add 'focus' event
Can we find a better name? I have considered the followings.
* 'point', because "the pointer" points to the current item.
* 'shift', 'switch', 'move', etc. These are not technically correct
because the current item can change without cursor movement (--tac,
reload, search update)
* 'change' is already taken. 'change-current' feels a bit wordy and
sounds wrong, 'current-changed' is wordy and doesn't go well with the
other event names
* 'target', not straightforward
Close #3053
Diffstat (limited to 'man')
-rw-r--r-- | man/man1/fzf.1 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 70faf8a3..a2e8c41f 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -959,6 +959,22 @@ e.g. \fB# Move cursor to the first entry whenever the query is changed fzf --bind change:first\fR .RE +\fIfocus\fR +.RS +Triggered when the focus changes due to a vertical cursor movement or a search +result update. + +e.g. + \fBfzf --bind 'focus:transform-preview-label:echo [ {} ]' --border --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' --border --preview 'cat {}' + + # Beware not to introduce an infinite loop + seq 10 | fzf --bind 'focus:up' --cycle\fR +.RE \fIbackward-eof\fR .RS @@ -983,11 +999,11 @@ A key or an event can be bound to one or more of the following actions. \fBbackward-word\fR \fIalt-b shift-left\fR \fBbeginning-of-line\fR \fIctrl-a home\fR \fBcancel\fR (clear query string if not empty, abort fzf otherwise) + \fBchange-border-label(...)\fR (change \fB--border-label\fR to the given string) \fBchange-preview(...)\fR (change \fB--preview\fR option) - \fBchange-preview-window(...)\fR (change \fB--preview-window\fR option; rotate through the multiple option sets separated by '|') \fBchange-preview-label(...)\fR (change \fB--preview-label\fR to the given string) + \fBchange-preview-window(...)\fR (change \fB--preview-window\fR option; rotate through the multiple option sets separated by '|') \fBchange-prompt(...)\fR (change prompt to the given string) - \fBchange-border-label(...)\fR (change \fB--border-label\fR to the given string) \fBchange-query(...)\fR (change query string to the given string) \fBclear-screen\fR \fIctrl-l\fR \fBclear-selection\fR (clear multi-selection) |