onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.35k stars 299 forks source link

Feature: Projects. Easily switch between coding Projects #2209

Open jeffbdavenport opened 6 years ago

jeffbdavenport commented 6 years ago

Forgive me if I'm doing something wrong, this is the first time I've made a Feature Request for Oni.

I would like to develop a feature to be implemented into Oni, however, instead of going through all the effort for nothing, I would like to have it approved first.

For a brief summary, I am going to add either another menu button between Oni and Edit called Project, or an icon to the left of the explorer This menu item will have this subset of items along with a description of what they will do

I intend for each project to do these things

When you open Oni it will remember what project you were last on and it will use that.

I realize that this kind of thing is already possible to do with Promiscuous, but that is kind of the point of the IDE to make things out of the box awesome.

oni-bot[bot] commented 6 years ago

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

CrossR commented 6 years ago

This is somewhat related to Session management in Vim, which we spoke about on Discord a while back but I think never made it into an issue.

I think the main point there was that ideally, this style of functionality would also work for the multiplexed editors that Oni supports. That is, when "editor.split.mode": "oni", is set, so there is multiple instance of neovim sat around. This just changes it from "save all open buffers/locations/etc" to "save all open buffers/locations/etc for all editors".

A second point I'd have is that whilst its nice having it in the menu since that is probably where you will look first, a sidebar entry would be a nice addition also. That then means you can navigate and swap between projects without having to use the mouse. Or maybe if we added it to the API, that way users can bind it / make menus for it themselves...

That said, I'm not saying we'd need all that in one go, it would make sense to build up the feature, both to make testing easier, but also to get it out quicker and have it be used.

For the idea in general though, I'd love something like this! I'm currently using a vim plugin to manage my sessions, but if we could move it into Oni it would have the ability to work with a bit more of the Oni specific functionality which would be great.

akinsho commented 6 years ago

@jeffreydvp just wanted to point you to a few issues that exist around this i.e. ideas and points that have been raised - https://github.com/onivim/oni/issues/1225, https://github.com/onivim/oni/issues/1582

Re. this functionality its definitely something that I'd also like to see. Just a couple of things it be great to see with this is that however the ui manifests it v. keyboard accessible, although as it would likely involve using some of the existing components most of which are already targeted towards that hopefully that might be factored in by default.

Also I wonder how you were intending to manage the project/session @bryphe mention some ideas - hope he doesn't mind me adding what he already shared on the subject in here.

I think it would be awesome to have session management built in! I liked the direction where this was going: https://github.com/onivim/oni/issues/1582

Either exposing a list of sessions in the sidebar, or at the top of the editor - making it really easy to switch between them. I jump between projects frequently so it would be great to not have to rebuild the context each time. I'm thinking of how it would work in the Oni world, though - I'd want the session management to support the multiplexed editors - in other words, it would have to be implemented outside VimL to scale to that scenario. What I thought about was adding a persistSession: Promise and restoreSession(data: any): Promise for the Editor interface (or perhaps Window objects - that would let us persist state for stuff like the sidebar and file explorer even, if we wanted..) NeovimEditor would of course need to use :mksession as part of that, so it might write out the session file and save it as a string. Then, when we call persistSession and restoreSession on the editor, for the NeovimEditor, it would use mksession / so to store/restore the session info. But it could also scale to other types of editor strategies too. At the high-level, we could have some object like PersistentSessions that handles calling persist/restore on all the relevant entities, collect the data, and save the file somewhere (which would be an aggregated of all the session date).

jeffbdavenport commented 6 years ago

Thanks for the input here guys! I will do some research on the points mentioned and dive into how I'm going to accomplish this and add to this Issue as I progress. I think that #1582 goes quite a bit beyond the scope of what I am wanting to implement, but I might look into it regardless because I do like the idea there.

akinsho commented 6 years ago

@jeffreydvp 👍, yeah #1582 is more there for inspiration, than any kind of requirement any step(s) towards this functionality would be fantastic

Melkor333 commented 6 years ago

I've just made a comment to #1582 and for flexibility it would be the best if we have Projects > Workspaces > Oni splits/tabs/vim splits

It sounds complicated but would be the most reasonable thing. The additional workspaces would have their own function:

Having only either Workspaces or Projects seems a bit limited in my eyes and I think it makes way more sense to have workspaces as part of a project than as part of the layout.. Or what do you think?