Closed lamyergeier closed 3 months ago
is it possible to go to the end of each line to see the filename?
fzf --keep-right
fzf --preview "echo {}" --preview-window 'nohidden:wrap'
# just the filename
fzf --preview "basename {}" --preview-window 'nohidden:wrap'
see the man page for more infos about --preview-window
Related threads:
Thanks @LangLangBart I am using the basename solution that you described above (as in the below screenshot):
I was wondering if it was possible to high light the search letters in the preview box as well (with the blue colors) as shown in the above image.
Maybe you can test if this works for you.
fzf --preview "basename {} | grep {q} -i --color=always" --preview-window 'nohidden:wrap'
# {q} is replaced to the current query string
# -i : ignore case
# --color=always
It would be better to use BurntSushi/ripgrep or ack, both of which have an additional --passthru
flag to print matching and non--matching lines.
# ripgrep
fzf --preview "basename {} | rg --passthru -i {q} --color always" --preview-window 'nohidden:wrap'
# ack
fzf --preview "basename {} | ack --passthru -i {q} --color" --preview-window 'nohidden:wrap'
The latest version of fzf can print multi-line entries:
https://junegunn.github.io/fzf/tips/processing-multi-line-items/
And it can wrap long items:
man fzf
)Info
Problem / Steps to reproduce
Hey I checked the issues but I am not sure if this is answered, as it was mentioned that fzf doesn't support multiline command history.
But I wanted to ask if its possible to print long items in 2 lines instead of the ellipsis (2 dots) at the end, please see the following image:
I am doing something like this:
File="$(find | fzf)"
If its not possible to print in multi line, is it possible to go to the end of each line to see the filename? This occurs when file path is too big to fit on one line!