Skip to content
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

VIM-inspired split windows #1716

Open
krillr opened this issue Jul 31, 2016 · 26 comments
Open

VIM-inspired split windows #1716

krillr opened this issue Jul 31, 2016 · 26 comments
Labels
priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.

Comments

@krillr
Copy link

krillr commented Jul 31, 2016

I'd love to see VIM's window-splitting capabilities brought to QuteBrowser. As far as I can tell, this functionality doesn't exist anywhere.

@lahwaacz
Copy link
Contributor

It does, it's called tiling window manager.

@krillr
Copy link
Author

krillr commented Jul 31, 2016

That's not integrated into the browser, and doesn't necessarily use VIM's window splitting commands. I'd prefer to manage browser windows inside the browser -- as do most people who use VIM and its GUI derivatives while also using a tiling window manager.

@The-Compiler The-Compiler added the priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible. label Aug 1, 2016
@The-Compiler
Copy link
Member

I can see how this could be useful to some, but this is one of those things which is probably not going to happen until someone comes up with a very good pull request 😉

@nabsiddiqui
Copy link

Couldn't you gain a similar functionality by using something like i3 and setting "tabs are windows" to true? Currently, you can detach any tab into its own window and also open any url in its own window. While I could imagine if you weren't using a tiling window manager that this could be useful, if you are using one, what would be gained other than having to learn and set up another set of commands for moving between splitsi in the browser?

@krillr
Copy link
Author

krillr commented Aug 4, 2016 via email

@nabsiddiqui
Copy link

Yes, but when people use tmux/screen with i3 it is mainly for features that i3 can't also duplicate like resuming sessions, buffers, etc. I wouldn't see why one would use tmux or screen otherwise. You would just have to memorize more keyboard shortcuts rather than having a standardized one with the tiling window manager.

Either way, this is going off topic. I can see the benefit of using splits also if you aren't using a tiling window manager.

I'm not trying to be combative. I'm just trying to figure out if there is another way you can gain the functionality you desire, since the likelihood that this will be implemented in qutebrowser is currently very small.

@blyxxyz
Copy link

blyxxyz commented Nov 3, 2016

dwb has this feature.
dwb's view splitting

I can't get dwb to run without segfaulting, but I think you do that with xv, for toggling the visibility of a tab. A tab with visibility toggled stays visible in a split view when you switch to another tab.

@The-Compiler
Copy link
Member

That's an interesting approach - not full-blown tiling, but simply having an always-visible pane. Then again, I'm using a tiling WM, so I personally am not really interested in this feature 😉

@haasn
Copy link
Contributor

haasn commented Nov 3, 2016

To me it seems like the better way to approach this would be any necessary UX improvements to :tab-detach/:tab-attach:, because splitting and merging windows is basically already part of that workflow.

Personally, the only reason I use split windows in vim is because vim's limitations force a single-window workflow. (If I could open the same file twice, I would)

@lahwaacz
Copy link
Contributor

lahwaacz commented Nov 3, 2016

Vim doesn't have such limitation - you're likely limited by missing edit conflict resolution. This problem does not apply to read-only documents, including pages in qutebrowser.

In vim, :split results in two viewports on the same file - is something like that even possible with webkit/webengine?

@lamarpavel
Copy link

Vim doesn't have such limitation - you're likely limited by missing edit conflict resolution. This problem does not apply to read-only documents, including pages in qutebrowser.

This is an important point. It raises the question what kind of communication we expect split windows to have. Web-pages aren't entirely read-only, think about input fields or drop down menus, or anything involving ajax etc.
I can't see any use in multiple views on the same page in a webbrowser except to view different parts of the page side by side (eg. the index at the top and some text in the middle), but that does not justify all the added complexity for me.

Split windows that aren't views on the same object are an entirely different beast. I think this is what @haasn was talking about. But the question about expectations are still there as soon as you compare it to vim. The discrepancy between vims buffers and views on files and a webbrowsers interaction with webpages is subtle at first but comes with different expectations that make it hard to unify. Thus, I would rather not have split windows in qutebrowser but instead well established workflow between separate windows .
Of course, it is not trivial to implement all the functionality of split windows with separate windows, but I think we should first try that route and see what's possible.

@haasn
Copy link
Contributor

haasn commented Nov 4, 2016

Vim doesn't have such limitation - you're likely limited by missing edit conflict resolution.

Yes it does - I can't share state (e.g. buffers, macros, clipboards etc.) between multiple windows, so I'm forced to constrain myself to a single window / vim instance if I don't want to impact my usability.

For qutebrowser similarly, we have to ask ourselves what state users will want to share between windows. Fortunately, qutebrowser already supports multiple windows already which means we already share most of the state, and I'm not sure what is left.

@lahwaacz
Copy link
Contributor

lahwaacz commented Nov 4, 2016

Yes it does - I can't share state (e.g. buffers, macros, clipboards etc.) between multiple windows

That does not prevent you to "open the same file twice", as you mentioned in your previous post. See @lamarpavel's post above for the state that is not shared between tabs/windows.

@a-roy
Copy link
Contributor

a-roy commented Sep 25, 2017

I did some research on how this could be done, and I learned that the QTabWidget internally uses a QStackedWidget, which in turn uses a QStackedLayout to control the visibility and geometry of the pages. PyQt doesn't seem to give us access to that QStackedWidget (correct me if I'm wrong), meaning we can't directly override the behavior by inheriting from it. We will have to set up the geometry and visibility of the tab pages somewhere in the TabWidget or TabbedBrowser classes and ensure that these settings take precedence over the ones set by the QStackedLayout.

@lufte
Copy link
Member

lufte commented Jan 31, 2018

I'm working on a possible implementation for this. My idea is to split what's currently a Tab into a Tab and a Pane. The Pane would keep most of the functionality (everything web related, particularly) of the current Tab, while the new Tab would just be that, a tab, with a name, an icon and a container for one or more Panes arranged in a QGridLayout.

The tab bar will remain the same, each tab would show the name and icon of the page in their active pane. Same for the status bar.

@The-Compiler
Copy link
Member

Thanks for taking a look! FWIW I don't want to stop you, but this is something where I'm not sure yet whether it's worth the complexity it entails. If you can get it to work and it's simple enough then sure, let's go for it - but if it introduces too many funny corner cases, this might be something I'll have to say "no" to.

@lufte
Copy link
Member

lufte commented Jan 31, 2018

Sounds fair. I might not even go all the way with it, but if do I'm hoping it is with a clean design. In anyway it will allow me to familiarize myself with the codebase and maybe tackle other issues.

@toofar
Copy link
Member

toofar commented Jun 2, 2018

Seperating the display tab from the web renderer might make proper lazy loading easier too.

@lufte
Copy link
Member

lufte commented Jun 4, 2018

I've been working on a standalone project for a QLayout that resembles Vim splitting behaviour here https://github.com/lufte/tiling-layout, specifically to implement this feature. Hopefully I'll be able to get started soon.

@lufte
Copy link
Member

lufte commented Oct 26, 2018

Hey guys, if you want to check out a super alpha implementation of this, you can do so at https://github.com/lufte/qutebrowser/tree/1716-20180930. Just follow the normal instructions for building qutebrowser from source but use that branch instead. Everything is absolutely broken, so don't try any fancy commands or stuff like that. You'll basically be able to :split or :vsplit panes, move between them with :pane-(left|top|right|bottom), and close them with :pane-close.

This will take a lot of work, but at least we have something to try out now. @The-Compiler if you are completely sure you'll never want to implement this, now is the time to say so and I'll stop working on it. If you're still unsure then no worries, you can always say no later 😄

@rakanalh
Copy link

rakanalh commented Apr 8, 2019

One of the very nice features that we'll get when implementing this is the fact that we can get the inspector in the same window rather than a separate one. I am currently using the i3wm to put those side by side but it's a bit annoying TBH.

@The-Compiler
Copy link
Member

@rakanalh I kinda see that as a separate thing because it requires much less thought (it's clear that commands always go to the main webview and not the inspector; it's relatively straightforward how it should behave together with tabbing, etc.) - in fact, there's already an open PR: #4290

@fzf
Copy link

fzf commented Sep 19, 2019

@The-Compiler bumping @lufte version with basic implementation. @lufte any reason you didnt make a PR for it?

@lufte
Copy link
Member

lufte commented Sep 20, 2019

Yes, it's still lacking a lot of work and I'm not certain that it will be merged given the amount of pending issues and pull requests; specially if it's not a priority. I also started considering (as other users pointed) that maybe this is a responsibility for the window manager... I particularly started considering that when I became aware of all the work needed to implement it 😄

@Slider-Whistle
Copy link

Not important at this point, but I know of one plugin for either Chrome or Firefox (I forget) that would use this hack where it moves the current web page into a HTML frame on the left side of the screen.

@lufte
Copy link
Member

lufte commented Jan 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.
Projects
None yet
Development

No branches or pull requests

14 participants