-
Notifications
You must be signed in to change notification settings - Fork 38
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] Option to rank opened files on the top of the rest #272
Comments
What about the “workspace” feature? For example, you would have many projects grouped into 2 ones.
And you should have settings below. require("telescope").setup {
extensions = {
frecency = {
workspaces = {
group_A = "/home/foo/group_A",
group_B = "/home/foo/group_B",
}
},
},
}
Can this solve your issue? |
@delphinus many thanks for taking a look at my request and even coming up with the suggestion, yes, I think, definitely makes sense! That's actually quite close to what I mean, but obviously needs some part of pre-configuration of the workspaces to be used. This is also a way to go, given the projects are usually long-term and it's not a big deal to print a line in the config. What I'd ultimately love to see is actually the same workspace which is collected on the go, some kind of "live workspace" in these terms. I think, it's handy to have not only because less configuration, but also following the essence of the programming process, which is quite creative and changing and at times you even don't know what project or what workspace you're in at the moment — you just seem to remember you've seen that nice piece of code a couple of files ago :) |
I see. Yes, my plan needs pre-configured structure of repositories. It is ideal that telescope-frecency can attach importance to candidates that are in the same projects as already opened ones. I'm thinking two plans to implement. As precondition, you have these candidates as below.
Plan 1: Only opened files precedes against others.When you have opened (B2) and (A2), 60 ~/project_B/index.html -- opened
20 ~/project_A/LICENSE -- opened
100 ~/project_A/lib/foo.js -- not opened
80 ~/project_B/README.md -- not opened
60 ~/project_B/index.html -- not opened
40 ~/project_C/package.json -- not opened
10 ~/project_B/image.jpg -- not opened Plan 2: All candidates in the same projects precedes.In the same situation: you opened (B2) and (A2), then see this. 100 ~/project_A/lib/foo.js -- not opened
80 ~/project_B/README.md -- not opened
60 ~/project_B/index.html -- opened
20 ~/project_A/LICENSE -- opened
10 ~/project_B/image.jpg -- not opened
40 ~/project_C/package.json -- not opened Probably your plan is Plan 1. But I think Plan 2 is effective for some situations. Which one do you like or both plans? |
Thank you for such a detailed illustration to both of the directions! It really helps to clarify the ideas. Yes, indeed, I like Plan 1 a little more and that's exactly what I initially meant. Basically, I see a couple of pros in favour of it:
Still, your Plan 2 looks quite interesting to me, too. I haven't thought of something like that, but with your illustration it looks nice and natural to use and also looks like a step forward in the way of the workspace concept (something like "auto-detect projects as workspaces"). So now in my ideal world I see both of these, but yes, I think, any of them which is easier to implement would be great to have. |
@delphinus thank you very much for the implementation of both scenarios! Such a quick one! Sure, I've just switched to the feature branch in my configuration to try it in the real work. I've only just added a couple of little fixes to make it work as I would expect, at least for the Plan 1 scenario, I'll publish a pull request for it right away. Sorry, I'm not the best Lua programmer, so that's pretty much only a proof of concept) It also tends to make Plan 2 work following your previous illustration. As for naming, maybe I'm a little subjective being deep in the context after our discussion here, but all the terms look very clear to me. So, in my opinion, they are just fine. Many thanks again for implementing it! Oh, I'm just happy, it looks like what I really wanted to make my every day work in neovim much more pleasant! :) Well done! |
@delphinus oh, brilliant! Thank you very much for making it possible, for your great help with this feature and for your kind and constructive approach! It was a pleasure to discuss all the details here and finally come to so nice implementation. I wish all the best to your project! Will be use it with even more comfort now and yes, would be happy to return with another idea sometime :) Thank you very much! |
Could you please consider adding an option to list opened files on the top of the list, still sorted? In my imagination it could be two groups: opened and not opened files, each of the two sorted according to the config.
The use case it quite simple: I'm working in several windows with a limited suite of files (not only within one project, the context could be larger, e.g. when I have to take a look at some external sources) and they are the hottest for the current working session, so I expect to see them at once in the list. Still I might previously work with some other suite of files for quite a long time (e.g. with my previous employer, hah), so those keep having quite high scores and being listed quite high, which is now not desired.
The text was updated successfully, but these errors were encountered: