Skip to content

Conditional preview configuration based on current line #3884

Answered by LangLangBart
danrlavoie asked this question in Q&A
Discussion options

You must be logged in to vote

I'd really like to be able to either:
--preview "bat --color=always --highlight-line ${{2}:-1} {1}

Would this serve as a solution ?

cat <<'EOF' | fzf --delimiter ':' --preview 'line={2}; bat --color=always --highlight-line ${line:-1} {1}'
/usr/share/misc/ascii:8
/usr/share/misc/ascii
/usr/share/misc/birthtoken
/usr/share/misc/birthtoken:2
EOF

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@danrlavoie
Comment options

Answer selected by danrlavoie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants