I work with very long file paths. I want to show the ending of the path (near where the files are). Is this possible?
It is possible.
echo '/very/long/file/path.sh' | fzf --delimiter / --with-nth -1
Not exactly what you want, but another thing you can do is to enable toggleable (or always-on) preview window for showing the full path.
fzf --preview 'echo {}' --preview-window down:2
fzf --bind ?:toggle-preview --preview 'echo {}' --preview-window hidden:down:1
It seems that the preview window approach is also truncated at the end. Is there any other solution for maximizing the amount of path that is shown starting from the end?
@junegunn
Not exactly what you want, but another thing you can do is to enable toggleable (or always-on) preview window for showing the full path.
fzf --preview 'echo {}' --preview-window down:2 fzf --bind ?:toggle-preview --preview 'echo {}' --preview-window hidden:down:1
Can we have a way to just prioritize showing the end? I do not want the --with-nth because I need to search through the higher dirs sometimes, and the preview window solution doesn't let me see everything at a glance.
Check out --keep-right option.
Just another option if all you care about is the last field Two solutions come to mind
fzf --preview=“basename <<<{}”
fzf --preview=“awk -F/ 'NF>=3{ print $(NF-2), $(NF-1), $NF}' <<<{}” #last 3 fields
Wrap in a while loop-
Where output grater than fzf_default_columns do truncate
Most helpful comment
It is possible.