m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 16:36:58 -05:00

Add placeholder expression for zero-based item index: {n} and {+n}

Close #1482
This commit is contained in:
Junegunn Choi
2019-02-19 01:12:57 +09:00
parent 315e568de0
commit 6c32148f90
3 changed files with 27 additions and 12 deletions

View File

@@ -301,7 +301,9 @@ e.g. \fBfzf --multi --preview='head -10 {+}'\fR
When using a field index expression, leading and trailing whitespace is stripped
from the replacement string. To preserve the whitespace, use the \fBs\fR flag.
Also, \fB{q}\fR is replaced to the current query string.
Also, \fB{q}\fR is replaced to the current query string, and \fB{n}\fR is
replaced to zero-based ordinal index of the line. Use \fB{+n}\fR if you want
all index numbers when multiple lines are selected.
Note that you can escape a placeholder pattern by prepending a backslash.