Skip to content
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

Allow different options for FzF in interactive filtering #137

Closed
Nelyah opened this issue Dec 31, 2021 · 4 comments
Closed

Allow different options for FzF in interactive filtering #137

Nelyah opened this issue Dec 31, 2021 · 4 comments
Labels
feature request Something is missing

Comments

@Nelyah
Copy link
Contributor

Nelyah commented Dec 31, 2021

Thank you for the tool, it is a brilliant piece of software which I'm enjoying very much!

One of thing I wish would be possible is adjusting the FZF parameters. The one I'm thinking most is --height 40% (instead of 100% in zk edit -i). I've looked a bit at the code and it seems to be set in internal/adapter/fzf/fzf.go:75.

One solution would be to prepend that list of arguments with the env variable $FZF_DEFAULT_OPTS if it exists, and append to the list custom options that could be defined in the .zk/config.toml. This would make the default config for fzf in zk override the default fzf config (makes sense to me) but would still allow users to override the zk default config (fzf --height 100% --height 40% results in height at 40%).

Do you think this would be possible?

@mickael-menu mickael-menu added the feature request Something is missing label Dec 31, 2021
@mickael-menu
Copy link
Member

Thank you for the tool, it is a brilliant piece of software which I'm enjoying very much!

Thank you for the kind words!

One solution would be to prepend that list of arguments with the env variable $FZF_DEFAULT_OPTS if it exists, and append to the list custom options that could be defined in the .zk/config.toml. This would make the default config for fzf in zk override the default fzf config (makes sense to me) but would still allow users to override the zk default config (fzf --height 100% --height 40% results in height at 40%).

That sounds like a good strategy. The user options could be specified in the configuration file:

[tool]
fzf-options = "--height 40%"

Would you be interested in contributing a PR for this?

@Nelyah
Copy link
Contributor Author

Nelyah commented Dec 31, 2021

I will try to see in the next few days if I can come up with something, though I have never really written a single line of Go before.

The issue doesn't seem too complicated though, so maybe I'll be able to get something working and this would be a good introduction to the language. I'll let you know how this goes!

@mickael-menu
Copy link
Member

Thanks, you can create a draft PR and if you check the "Allow edit from maintainers" checkbox while creating the PR I can finish it for you if needed.

@mickael-menu
Copy link
Member

fzf-options is now available in main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Something is missing
Projects
None yet
Development

No branches or pull requests

2 participants