m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-19 09:03:43 -05:00

Inject $LINES and $COLUMNS when running preview command

Close #1168
This commit is contained in:
Junegunn Choi
2017-12-01 03:27:58 +09:00
parent b3b101a89c
commit f6b1962056
3 changed files with 14 additions and 5 deletions

View File

@@ -272,14 +272,17 @@ string, specify field index expressions between the braces (See \fBFIELD INDEX
EXPRESSION\fR for the details).
.RS
e.g. \fBfzf --preview="head -$LINES {}"\fR
e.g. \fBfzf --preview='head -$LINES {}'\fR
\fBls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1\fR
fzf overrides \fB$LINES\fR and \fB$COLUMNS\fR so that they represent the exact
size of the preview window.
A placeholder expression starting with \fB+\fR flag will be replaced to the
space-separated list of the selected lines (or the current line if no selection
was made) individually quoted.
e.g. \fBfzf --multi --preview="head -10 {+}"\fR
e.g. \fBfzf --multi --preview='head -10 {+}'\fR
\fBgit log --oneline | fzf --multi --preview 'git show {+1}'\fR
Also, \fB{q}\fR is replaced to the current query string.