-
Notifications
You must be signed in to change notification settings - Fork 12
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
Multiple alternatives based on framework/language #25
Comments
That seems interesting. I would like some feature like that too, which could be configured with a config file so that the codebase remains language/framework agnostic. If there's interest from the authors, I would be more than happy to draft a feature proposal of how it could work, and implementing it. |
So, the original incarnation before Though, it continued to have maintenance issues because it turns out it is difficult to account for all the possible cases in your regex, lol. Also, I started running into issues where certain frameworks/languages were conflicting with others in terms of patterns and detection. So, I built Maybe having the switches/modes would be fine though if we had a default (general mode), and then the switches. |
So, I was thinking about this more this morning and it now has me re-thinking the filter by classification strategy. I think a better strategy would be some sort of additial weighting system. Lets look at the following example: File you are currently in:
Possible alternates:
Ignoring test classification and test word stripping. In the above case However what we would want in this scenario probably for We could accomplish this by introducing a weighting system that improves the similarity score based on some heuristics. This could be based off the extension or based off other words found in the possible alternate path and filename. |
I'm playing around with an implementation of the same alt functionality here: https://github.com/gugahoa/fzf_alt My bet was that I left the strip + test regex up to the user to configure, as that can have particularities that's up to the user. I'm still playing around with how to implement how to alternate between things like |
@gugahoa this project is actually based on the core of https://github.com/BurntSushi/ripgrep. Originally it wasn't but then I worked with ripgreps core dev to get the foundation of ripgrep integrated for the same reasons. |
Thinking about this more. I think having framework specific support probably isn't the correct approach. Instead I think it should instead maybe be the algo for identifying the alternate file. Maybe there are different approaches
|
I just released v4.0.0 which has a more generalized algorithm that I think should aid with this. |
This is more like a question than an issue regarding the path of this project. I think it would also be useful to get alternatives to .html / .ts / .scss files for Angular development, or similar couplings for other projects.
Current the way of handling alternatives does not allow this, do you think it would be helpful to have 'switching patterns' and get those different patterns in some order so editors can swap them?
For example calling alt with
alt --angular
would swpa foo.html , foo.ts and foo.scss, oralt --react
would suggest foo.jsx or foo.css . Or evenalt --c
would swap foo.c and includes/foo.h ... even more alt --no-file-check feature so editor can create this file if it does not exists.The text was updated successfully, but these errors were encountered: