-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Feature request] fzf integration #2927
Comments
@chrisant996 Can you please give a short list of requirements for implementing this in Cmder, if any? How much additional space would you estimate this will require? |
I also found this interesting gist for using fzf for history: |
It's covered in detail in the docs here: https://github.com/chrisant996/clink-fzf/#fzf-integration-for-clink Note the settings and key bindings. Here is a quick summary to get you started:
These things are needed:
The size of
No, don't use that: Clink-fzf already has support for fzf history. The cited gist is missing all of the rest of the fzf support. The gist appears to be only trying to change clink-fzf's history implementation to print "Searching History" first, but it has bugs in how it tries to do that, and it won't work properly. (And the official fzf support in other shells doesn't print that.) |
Also, if you make Cmder by default enable the fzf default key bindings, you'll receive complaints about Tab no longer working as expected. Anyone who has bound Tab to any of the completion commands other than I'll try to make the script do its best to compensate for that. It'll probably be able to "magically" do what people expect for 99% of users, but in some fancy custom configurations it may still interference. |
@chrisant996 Thanks, in addition to that, I believe it would be best for the "conflicting" features to be opt-in and enabled through some sort of config, and instructing users to use a command line text editor to enable those that they'd like. Clink already has an excellent mechanism to enable/disable configuration through its |
|
The fzf integration in I had interpreted the original request as "enable fzf integration by default".
I noticed that a change was made to turn on But I think instead Cmder should be using See notes under Files. Cmder could simply include a file |
Good points, also I like the idea of the lua scripts being able to deal with multiple instances being loaded from multiple places, since there are users who unknowingly install both. The integration can be made after handling such cases are made within the code, in the meantime I'll read the documentation to better understand how each feature works and what we can offer to first time users, as well as "pro" users who have been using Cmder/clink for some time. Clink really is the best shell on Cmder! 😄 |
On the surface, it sounds great, right? If all the different copies are identical, then it's great, right? But in reality, the different copies will usually end up being different. And then things get confusing and weird and problems happen and people report bizarre issues that take many hours to track down. After doing some work to prototype "multiple versions coexisting", it's a bit of a mess (as should be expected), and there's no way to make it fully reliable for all kinds of duplication situations. I'm leaning towards adding some Lua code in Cmder that loads a built-in copy unless another copy is loaded. That would make it so Cmder comes with built-in fzf support, but if a user has installed clink-fzf or clink-gizmos then the user's version gets used instead. It's easy to make that reliable. Does Cmder plan to include fzf support for powershell, git-bash, etc? Or will it be only for cmd/Clink? |
Just mu $.02. Keep in mind I have no idea how to do it for one shell much less all of them, I just think if we do it for one, we should do it for all. The same fzf.exe should work for all I would think. |
The same fzf, yes. But the integration is different for each shell. If the goal was "just run And I think that's also a mark against configuring Clink in a way that's too different from how powershell/etc behave. If Cmder's goal is to provide an environment where all the shells behave the same, then that has to cater to the lowest common denominator and also avoid things that involve a bunch of configuration. |
I'm not the one asking for the feature. It is installed in my Linux and configured and I never use it. Maybe because I know nothing about it. I have seen it used but it is more different stuff for me to remember and that does not always work so well for me. Too much going in and out as it is so new stuff has a hard time getting retained. :-) |
@chrisant996 It's an excellent idea, especially since if a copy is already loaded, it wouldn't make sense to unload that so that Cmder could load its own. (If for some reason the user prefers the copy that is included in Cmder, then the idealistic approach would be to somehow load the included version before the existing copy outside Cmder is loaded). I haven't looked at the lua scripts deeply, so that's just my intuition.
I haven't had heard of I don't believe we should focus on integrating everything on every shell for now
I agree. How about another approach, then? We don't exactly have to include What we can do instead is to give the user the option to install these packages into their Cmder installation in a compatible way that wouldn't break Cmder and/or conflict with the existing configuration. In this way, we can modify the current lua scripts in both Cmder and the As @daxgames have said before, one of the core points of Cmder is that it's portable, you can copy it around using a USB stick and access the same shell and tools. Would it be possible to install Another method of using Lastly, if this works, maybe in the future we can provide a @daxgames Also on the topic of cli commands, I have been working on a project called "Cmder Tweaker" on and off for the past couple of years, it's a script that I have been experimenting with that would allow applying customizations and configurations directly from the cli to Cmder, things such as setting the font, theme, default task, prompt colors, as well as registering profiles, context menu, and adding/removing env vars. I haven't committed it to a repo, since I'm experimenting with different scripting languages (powershell, cmd, bash), but if it comes to fruition, it would be a nice tool to add to Cmder where the user would have the ability to do |
I simplified it further: the last copy of the script loaded will win. Which means Cmder will be able to simply include clink-fzf as a vendor directory like it does for clink-completions, and Cmder load the script using the same kind of approach it uses for clink-completions.
It sounds like there are differences of opinions, so I think that's something for the Cmder maintainers to work out among yourselves.
I'm not sure what you mean. Are you suggesting that
The question is ambiguous. Are you trying to figure out how to tell Clink what directories to load scripts from, so that users can manually add directories inside the Cmder directory hierarchy and Clink will find them and load them? Cmder is already doing that to load clink-completions. Cmder can load scripts from wherever it wants.
Yes, that's what people have been doing so far.
It's possible to make an auto-updater for clink-completions inside Cmder. If a script updater is on by default, then a side effect is that it will automatically silently discard any local edits that users have made to the scripts. It's also possible to make a script that can update clink-completions. It's just a matter of extracting the contents from the latest .zip release file into the vendor/clink-completions directory. |
@chrisant996 Sorry for the ambiguity, you're quite right. Additionally, I wonder what approach could be used to include the scripts with Cmder yet leave it disabled. Do we need to put the scripts in a directory that won't be loaded by default, and either a) ask the user to move the files into another directory, or b) change the configuration to load scripts from the specified path? I'm under the assumption that there are no config files that are used to disable/enable scripts that are loaded by clink (sorry if that's the case).
That's a non-issue in my opinion since we have instructed users for many versions now (since a couple of years, I believe) NOT TO modify scripts in the This is off topic, but may I ask that you'd add this functionality directly in either |
Cmder needs to do what Cmder does for clink-completions (please follow the link to see what Cmder already does). The clink-completions directory is a custom directory, and Cmder has Lua code that specifically loads each of the scripts in that directory. Cmder can continue to use the same approach for any other Lua script collections that Cmder wants to include.
I welcome the question, but the answer has to be "no" about building it into Clink, because:
|
Suggestion
fzf clink integration in cmder shell
Use case
No response
Extra info/examples/attachments
https://github.com/chrisant996/clink-fzf
or
https://github.com/chrisant996/clink-gizmos
Checklist
The text was updated successfully, but these errors were encountered: