Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skim needs a printf #540

Closed
EvanCarroll opened this issue Sep 12, 2023 · 0 comments
Closed

Skim needs a printf #540

EvanCarroll opened this issue Sep 12, 2023 · 0 comments

Comments

@EvanCarroll
Copy link

EvanCarroll commented Sep 12, 2023

Brothers in Rust, it was brought to my attention that a new user of skim is executing a heathen program written in an inferior language because we lack a printf, observe

sk --ansi -mic "rg --color=always -n {} $1" --delimiter ':' --preview "bat {1} -H {2} -f --style=full"

In this execution we call out to rg --color=always -n {} $1 interactively. The output of that is in filename:linenumber:linecontents this gets broken up with the glorious argument --delimiter ':' which subsequently gets previewed with an execution of bat {1} -H {2} -f --style=full. Now when sk is given the command to select, there is no ability to the say you only want {1} or {2} or how you want the sk to output. What they're doing is this,

sk --ansi -mic "rg --color=always -n {} $1" --delimiter ':' --preview "bat {1} -H {2} -f --style=full" | awk -F ":" '{print $1}'

Which offends all of the Gods. It would be far more desirable to support this,

sk --ansi -mic "rg --color=always -n {} $1" --delimiter ':' --preview "bat {1} -H {2} -f --style=full" --printf "{1}"

We can even borrow the same logic in --preview, and just apply it to the output.

@skim-rs skim-rs locked and limited conversation to collaborators Dec 3, 2024
@LoricAndre LoricAndre converted this issue into discussion #650 Dec 3, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant