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

Resize windows #1176

Open
bestouff opened this issue Nov 26, 2021 · 9 comments · May be fixed by #8546
Open

Resize windows #1176

bestouff opened this issue Nov 26, 2021 · 9 comments · May be fixed by #8546
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements E-help-wanted Call for participation: Extra attention is needed

Comments

@bestouff
Copy link

There's currently no way (that I see) to resize a window, once split.
There probably need some actions like "window-enlarge-horizontal", by default bound to keys like "C-S-right".

@bestouff bestouff added the C-enhancement Category: Improvements label Nov 26, 2021
@pickfire pickfire added A-helix-term Area: Helix term improvements E-help-wanted Call for participation: Extra attention is needed labels Nov 26, 2021
@Termina94
Copy link
Contributor

Termina94 commented May 30, 2022

I have a branch working for horizontal resizing using a flex-like modal as recommended here by @archseer #1185
Has an interesting effect when expanding a centre buffer of 3 however lacks the fluidity of having a float/percentage modal

Which of the following two methods has the preferred outcome? Or do we add a config option to choose between either?

flex:
ezgif com-gif-maker (2)

float/percentage:
ezgif com-gif-maker (3)

@archseer
Copy link
Member

Hmm, how different is the implementation between the two?

@Termina94
Copy link
Contributor

Termina94 commented Jun 7, 2022

I have been playing around with different solutions to this issue and the nicest way I have found is using a flex-like approach where the parents container is split between the children bounds.

i.e | 1 | 1 | or | 2 | 1 | etc.

However this will not allow for reducing the size of a container that defaults to the value 1 and therefore all resizing will have to be managed by growing other children to make the one you want smaller which is not very intuitive.

For this draft example I have decided to hard code a slot limit per child of 20 and the each child starts with a default of 10. This feels much nicer but limits the accuracy of where you can resize your buffers to with a max of 20 potential sizes.

I have also added a focus toggle that will set the current buffers bounds to double the limit, ensuring it takes the majority of screen space allowing quick toggle to focus on different files which works quite nice with the flex approach.

As it stands this will be a draft until people have a play with the branch and we decide on a solution

#2704

tl:dr

suggestions pls
keybindings for this draft are alt-w

@the-mikedavis the-mikedavis linked a pull request Jun 7, 2022 that will close this issue
@cor
Copy link
Contributor

cor commented Oct 19, 2022

id like to add that it would be really nice if you could use the mouse for resizing windows by dragging on the windows borders

@brokenthorn
Copy link

brokenthorn commented Sep 1, 2023

It would be nice if resizing was modal. A key combination enters the resize mode (C-w, r). Then you get to pick which separator you want to move. You use the directional keys (arrows or hjkl) to move the currently selected splitter up or down, left or right, depending on what direction splitter it is. You can press something like SPACE and SHIFT-SPACE to select the next or previous splitter. Alternatively you can hold SHIFT and the directional keys can be used to select the next closest splitter by direction, giving a bit more control. Pressing ESC would exist window resize mode.

Disclaimer: I'm new to Helix and I could say new to Vim as well (it's been many years). Thinking of getting back into nvim and/or helix and didn't know how to resize splits in helix, so I ended up here.

@indiejames
Copy link

indiejames commented Sep 10, 2023

I know this is completely out of scope, and quite possibly not the direction the project would want to go, but for me the best solution would be to have the windows managed by something like zellij or tmux. For example, I create multiple zellij panes each with the same directory, then I run hx . in each one. Subsequent invocations of hx . after the first one recognize that there is a helix process running using the current directory (workspace?) and attach to that, sharing buffers, global actions, etc.

I guess this would involve some sort of client/server model, which may not be where helix wants to go, but it would allow me to use a single thing (zellij / tmux) to control my windows / panes, and would allow me to arrange my editor / shell windows however I wanted.

@pascalkuthe
Copy link
Member

pascalkuthe commented Sep 10, 2023

see #312 but that is quite a large effort and I am personally not sure if/how well that would really work (for example around LSP).

Either way we do want to keep the builtin split functionality so that is not really relevant to this issue

@AlexanderDickie
Copy link
Contributor

AlexanderDickie commented Sep 13, 2023

see #312 but that is quite a large effort and I am personally not sure if/how well that would really work (for example around LSP).

@pascalkuthe curious why you dont think the client server model would work well around the lsp?

@Termina94
Copy link
Contributor

Just linking for visibility.

#8546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements E-help-wanted Call for participation: Extra attention is needed
Projects
None yet
9 participants