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

full width/height horizontal/vertical splits #5643

Closed
rebelot opened this issue Nov 3, 2022 · 5 comments
Closed

full width/height horizontal/vertical splits #5643

rebelot opened this issue Nov 3, 2022 · 5 comments

Comments

@rebelot
Copy link

rebelot commented Nov 3, 2022

Sometimes, using the splits layout, I need to create a tall full-height window, or a wide full-width one.

Say I am starting from this configuration:

Screenshot 2022-11-03 at 08 55 54

I did not find a way to open windows to make it look like this, unless I plan it from the beginning which is not what I want.

full height split

Screenshot 2022-11-03 at 08 57 22

full width split

Screenshot 2022-11-03 at 08 56 49

thus it would be great if the launch command could take the --full option, e.g, launch --location=hsplit --full would create a full width horizontal window that splits the existing layout in halves.

Thanks a lot for your hard work on this!

@kovidgoyal
Copy link
Owner

I'm afraid there are an infinite number of "things I would like to do" from an infinite number of "current states". Trying to encode these as operations on launch is not feasible, at least for me. If you wish to develop a DSL for describing split layouts and how to transform them arbitrarily, then patches are most welcome.

@rebelot
Copy link
Author

rebelot commented Nov 3, 2022

I am sorry, I thought this splitting pattern was somehow popular enough not to be considered a whim of mine. Could this be encoded as a layout_action instead? The basic idea is to split the os window in half, horizontally or vertically. Every existing window will be then resized by halving its height or width. All these operations seem doable, since they are already implemented by other layouts. If you give me some pointers, I could try fiddling with splits.py

@kovidgoyal
Copy link
Owner

Yes, a layout action is definitely do-able.

@kovidgoyal
Copy link
Owner

Relevant function is layout_action() in splits.py. You will want
something like

map f1 layout_action move_to_screen_edge left|right|top|bottom

then for your use case you can do

map f1 combine : launch : layout_action move_to_screen_edge right

@kovidgoyal kovidgoyal reopened this Nov 3, 2022
@rebelot
Copy link
Author

rebelot commented Nov 3, 2022

That's awesome thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants