-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adding skim support #312
base: master
Are you sure you want to change the base?
Adding skim support #312
Conversation
PICKER env variable can have values (sk or fzf), if variable is not set, then fzf is used as picker. Like KUBECTX_IGNORE_FZF we have created one more KUBECTX_IGNORE_SK which will be used to ignore sk.
Renamed fzf.go to fuzzy.go since it is now more generic, refactored code to launch fuzzy search from func InteractiveSearch in interactive.go since it used by both kubens and kubectx
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Hey, sorry I've been slow reviewing things! |
@@ -29,4 +29,12 @@ const ( | |||
|
|||
// EnvDebug describes the internal environment variable for more verbose logging. | |||
EnvDebug = `DEBUG` | |||
|
|||
// EnvPicker describes the environment variable for fuzzy support, It can value | |||
// fzf or sk. If this is not set then fzf is taken as default picker. |
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.
If this is not set then fzf is taken as default picker.
My expectation of this feature was that people can set this to anything and we can feature-proof the tool. e.g. imagine a tool named abc
is developed in the future, I should be able to say PICKER=abc --opt1 -opt2
.
I think this is how more common env vars like EDITOR or PAGER in posix systems work. The caller has no information about the program it's calling other than it knows how to pass it the information (either via xargs or via stdin).
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 this way, we can retain fzf logic and have an override via PICKER
. The source code does not need to know about sk
at all.
For those who are waiting for this PR to be merged, you can create an alias with EDIT: typo |
See the Feature request here
Added skim support in kubens and kubectx go version.
Added environment variable PICKER which will contain value sk or fzf, if PICKER is not set or anything else is set other than sk and fzf, then it will by default pick fzf.
Created a func InteractiveSearch in interactive.go which will be called for fuzzy search and renamed fzf.go to fuzzy.go since it is now more generic.