-
Notifications
You must be signed in to change notification settings - Fork 170
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
Roadmap: External Apps as Buffers #582
Comments
@AndrewECarlson did you review tabgrid proposal? Nvim 0.4 also has "multigrid" (which is the foundation for "tabgrid"). I would avoid new "frameworks" and platforms-on-platforms, they generally just add entropy. |
@justinmk I'm not sure that solves quite the same issue, but I may be misunderstanding that proposal. That is for tying multi multiple desktop windows together into a single vim instance and switching between them by switching tabs and each desktop window would be displaying a vim tab. Right? I think you used Xmonad workspaces as an analogy there, and using tabgrid to solve this issue would make external apps that embed neovim use up a whole grid, which works for big external apps, like embedding a browser in neovim, but it would mess up any less intrusive user widgets, like if I wanted to extend the Shell widget to render image links inside the buffer or add a save button. Those types of widgets wouldn't be worth giving their own tab because you couldn't use splits. Sure a tiling window manager could mitigate that, but then you have to context switch for somewhat minimal gain. It was worth it to integrate terminals so we didn't have to use tmux. This seems similar. Especially since external tiling won't perfectly integrate into vim splits. |
(slightly disorganised rambling follows :D) First concerning the stackoverflow discussion. It seems to rely on Qt embedding foreign windows which is probably very tricky (e.g. https://bugreports.qt.io/browse/QTBUG-40320). With regards to EAF there are a couple of interesting things there. It seems to treat these apps as custom buffers where certain actions in the buffer map to some action in the app (say play or pause video). It seems like the input is being forwarded through EAF or emacs, but i did not look at this into detail. On a side note, a lot of the example apps in EAF were implemented from scratch which kind of defeats the purpose. What is usually unclear to me in these discussions is what model do we follow on how to handle input i.e.
Now, in the title you specifically mention buffers as being external apps. In which the app gets redrawn over the space meant for some specific buffer. This means that:
On a side note: The buffer model might not match here, since we can have one buffer in multiple windows, which would mean drawing the window in .... multiple locations/sizes. The extgrid approach makes more sense if we think about real application windows. But I dont know if vim/nvim has the notion of a special tab.
These are a bit different but we can rely on past experience for this:
What i mean is buttons and little elements are usually easier to do using custom buffers and plugins that interact with the UI. Anyway i lost my train of thought and have to go :S. Apologies @AndrewECarlson this ended up not being a very productive comment. PS: elvis (the best Vi clone) actually rendered html |
@AndrewECarlson Have you tried Oni or Oni2? It sounds like you're looking for a fully-featured/modern Neovim frontend. Your description sounds similar to the goals of OniVim to me :) Personally, I would like to see Neovim-Qt stay a lightweight and simple frontend. I like that this app is written with simple C++/Qt (ha!), and that it delivers a consistent experience across Windows/Mac/Linux. A live-update Markdown preview widget might be cool... |
@jgehrig I have seen oniviim, though I haven't tried it. I don't think thats really the solution. I'm looking for a way to extend the vim gui as needed. Onivim certianly has a lot of features that many would want out of a more full-featured vim gui, but it seems very opinionated and requires a license for commercial use. For me, that's enough to not want to contribute to it, and I suspect others feel the same. @equalsraf In EAF, I was mostly excited about qutebrowser. The others being made from scratch mostly seemed like trying to showcase the framework. I think for handling input sending everything to nvim is a good idea, and it could be like in terminal mode where by default only <Ctrl-\> <Ctrl-N> actually gets intercepted by default. Currently it looks like Shell handles the window splits, right? Would it be possible to create a QSplitter like with the file tree for each split? That way we could just inherit the position from the parent, or is that more/the same work? I would think you'd keep the cmdline visible below the statusline and just keep the widget sized to fit above that, like with terminal mode. What do you think? For getting around the multiple buffers issue, I was thinking if you open a widget buffer thats already in a window in a new window, you could move it the the new window and just display a text that says " open in another window, hit enter to move it here". The buffer workflow is so so nice, I want to use it for everything. I mainly think about this feature when I have dozens and dozens of desktop windows open. Your comment about elvis is something else I had been thinking about. A very nvim-centric approach would be to use html for the gui and let nvim plugins handle the gui plugins and just have nvim-qt render them. That would be cool in a lot of ways to further discuss. Would you be more on board with something in that direction? |
I would not want to bundle a browser with nvim-qt. Probably a separate app that links against the lib in this repo then.
I think the native splitter use case is covered by neovim's ui-multigrid extension, but we currently do not support it. https://github.com/neovim/neovim/blob/master/runtime/doc/ui.txt We actually do have a file tree view. Call
I have no specific preference for html as a format. But yes i would prefer to offload to existing solutions. Its probably easier to pick one use case and start with that. |
@AndrewECarlson I'm very interested in evolving the frontends this way. If I understand correctly, you're describing something like a declarative If so, here's a dump of my thoughts:
|
@yatli
What, if any, solution do you prefer for users being able to customize/extend the GUI? I'm sorry. I probably should have led with that, but I got excited about having thought of a potential solution myself. Some other formats I was considering besides reparenting
Are there any other formats you were considering/would prefer?
Are you saying that in order to embed user defined widget-buffers(via external apps or some other format), we'd first need to set up multigrid for the native splits? Sorry if I'm being dense, this is my first foray into neovim development, so all of the implications of multigrid aren't immediately apparent.
What do you think would be a good start? I realize this is kind of a huge feature, and I pitched it all at once. I just wanted to get it all out there so we could make sure development of each use case feeds into the next. One use case might be a widget that displays an image. It'd be pretty minimal on the widget development side but a decent proof of concept and be pretty useful on its own. Also, to clarify, I'm picturing users having a folder somewhere for all user-widget specific code, so that besides a general interface to widgets, they don't add maintanance burden to nvim-qt. |
@yatli Good question! I think Justin touches on this above too. @AndrewECarlson What are your thoughts on this? Do you have a plan to handle this? I don't think we should implement a new custom framework specific to neovim-qt. For most features it makes more sense to do the work in neovim instead. Images embedded within buffers are a good example (usefulness aside).
Not exactly. The UI feature ext_multigrid in neovim gives the front-end more control over how buffers are displayed, sized, and painted. The frontend can set each buffer's size and position independently. This would be useful if you wanted to support something like the camera in your emacs example. The TreeView works without ext_multigrid; it resizes the single grid, and paints itself on the side.
Adding support for |
@jgehrig Multigrid is making more sense. Justin was right, I needed to review it more for this conversation. Should we make a separate issue for multigrid support? I'm happy to work on it, but I'll have some questions and probably need a bit of direction. |
adding another potential use case: once I talked to the author of |
adding some thoughts: perhaps we should design a protocol that runs on the NeoVim jsonrpc channels. this paradigm can then be mapped onto UI framework capabilities, for example, qt signal/slot, XAML bindings or html event callbacks. |
@AndrewECarlson I've created an RFC in the neovim repo: neovim/neovim#12038 |
As discussed above, this feature would require API support from neovim. Tracking the work above. Marking as closed. |
First, thank you for all the work you have put into this project!
I have been thinking a lot recently about how we could get the kind of GUI extensibility that emacs has while staying inside a neovim type paradigm, when I came across the emacs-application-framework. It doesn't seem very active, but I think thats because the emacs community already has a variety of solutions to this problem.
I was looking into this related issue where you mentioned being open to other widgets, and this type of approach seems like it would minimize the maintainance burden of custom widgets while maximizing the flexibility.
Would you be interested in integrating something similar?
That project depends on having an X server, but it should be possible to make it cross platform per this stackoverflow question
It seems like that approach to GUI plug ins would fit really well with neovim. You could take an app that has neovim embedded or vim like bindings and embed it in neovim! That way you can keep all of your vim like thinking in one context.
It opens the door to a lot of interesting applications like...
This would also allow you to use vim as a limited tiling window manager so for development work where thats useful you can have that while still using a traditional desktop environment for things that don't play nicely with traditional floating window managers. I would also see this feature seeing a lot of use in windows where tiling window managers are less of an option.
Furthermore this seems like it would be something of a natural next step after terminal mode effectively made vim a terminal multiplexor. Sorry for rambling a bit at the end. I have been mulling this over for a little while now.
The text was updated successfully, but these errors were encountered: