-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add support for configurable extra fzf arguments #60
Conversation
via the environment variable _ZO_FZF_EXTRA_ARGS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think the variable can safely be renamed to _ZO_FZF_ARGS
without any loss in clarity.
As an aside, this is the second feature to require splitting logic due to the datatype being a list (along with #48), and it does make me wonder if switching to a TOML/YAML config file would be a good idea.
Somewhat off-topic for this PR, but related to @ajeetdsouza's earlier comment on configuration: While TOML/YAML configuration might be nice, I think that env var configuration is nicer. Want to test something? If we ship a default configuration file, we then have to make sure users know when new options are added, or options are deleted/deprecated. If we don't ship a default configuration, we have to make sure users know how to create their own. It also becomes another folder related to Overall, I much prefer having to use splitting logic over a separate config file, even if env vars were never truly removed. (If there's still more to discuss on this topic, maybe it would be better to open an issue and ping me there, or even email me, to prevent cluttering this PR further.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget a CHANGELOG entry, please :) Maybe:
### Added
...
- Specify additional arguments to `fzf` with `$_ZO_FZF_ARGS`
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than @cole-h's suggestions, LGTM
OK, hopefully this is ready now. It might be nice to add a suggested setting for $_ZO_FZF_ARGS in the README.md but I haven't settled on a "perfect" suggestion yet. So far I'm liking: $env:_ZO_FZF_ARGS = "--height 15% --layout=reverse --info=hidden --preview ""ls {2}""" |
If we want to suggest anything at all, I'd rather go for something simple: |
I think it would be best to add a link to the fzf documentation. I also just checked the I suggest:
|
I considered using
|
I can think of 2 solutions to this:
Of course, in either case, if the user wants default functionality and something extra, they could always go with |
Having given this more thought, I think this PR isn't that useful. If one wants to specify custom options, they should simply replace the appropriate aliases ( alias zi='FZF_DEFAULT_OPTS="--height 20" z -i' |
That is true. One could also alias |
via the environment variable _ZO_FZF_EXTRA_ARGS