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

option 'splitvertical' to split vertically by default #8350

Open
Synray opened this issue May 2, 2018 · 8 comments
Open

option 'splitvertical' to split vertically by default #8350

Synray opened this issue May 2, 2018 · 8 comments
Labels
enhancement feature request has:plan has:vim-patch issue is fixed in vim and patch needs to be ported has:workaround issue is not fixed but can be circumvented until then
Milestone

Comments

@Synray
Copy link
Contributor

Synray commented May 2, 2018

There's an old patch for Vim that adds an option, 'splitvertical' which opens splits vertically rather than horizontally by default:
vim-mq-patches/vertsplit
It's a nice option to have since most monitors are wider than tall. Could this be added as a feature? Or will something like this be exposed to plugins in the future.

@andreyorst
Copy link

most monitors are wider than tall.

While I understand that this may make sense, however vspl is one-letter longer then spl. Do you really need 451-line patch just not to type v every time? I's just mussle memory, I know

@silenc3r
Copy link

silenc3r commented May 3, 2018

@andreyorst Even shorter: vs and sp.

@Synray
Copy link
Contributor Author

Synray commented May 3, 2018

Even shorter: vs and sp.

Those are good shortcuts haha, however I'd mainly want to change the behavior for commands like :Man (bound to K), :help and :!. And some plugins that split don't expose an option for this. I think it would be much more convenient to set 'splitvert' in these cases. And I think exposing more UI behavior would be a good thing.
Most of the lines are documentation, but I think the number of changes could be reduced a bit. I'll implement this if it gets the go ahead.

@justinmk
Copy link
Member

justinmk commented May 4, 2018

:Man and :help support modifiers so :vert Man works.

exposing more UI behavior would be a good thing.

Preferably we would do that via events and window-layout functions, not more options.

OTOH 'splitbelow' and 'splitright' already exist, so 'splitvertical' seems justified.

The patch touches many areas, so tests are needed for all of them.

cc @akkartik

@justinmk justinmk added enhancement feature request has:vim-patch issue is fixed in vim and patch needs to be ported labels May 4, 2018
@justinmk justinmk added this to the unplanned milestone May 4, 2018
@chrisbra
Copy link
Contributor

chrisbra commented May 4, 2018

The patch touches many areas, so tests are needed for all of them.

That is only because it needs to pass the new flag WSP_VERT down to win_split. And that needs to be done everywhere where a window is actually split.

@justinmk
Copy link
Member

justinmk commented Dec 3, 2018

One can approximate this using the WinNew event, e.g.:

:autocmd WinNew * wincmd H

@justinmk justinmk changed the title Option to split vertically by default option 'splitvertical' to split vertically by default Dec 3, 2018
@justinmk justinmk added the has:workaround issue is not fixed but can be circumvented until then label Dec 3, 2018
@avalonv

This comment has been minimized.

@mawkler
Copy link
Sponsor Contributor

mawkler commented Mar 11, 2021

What's the status on this feature? I'd personally love it if I could get new windows to open vertically by default.

Another big motivation for this is that plugins that generate many windows like vim-fugitive would greatly benefit from this.

I think having to write vs or vert in front of every command is really annoying, and with the resolution and width of modern computer monitors it would only make sense to have this as a built-in option. I think it's odd that not even helpfiles open vertically by default these days since they always are around 80 characters wide, which leaves tons of unused screen space in a horizontal split on modern screens. I personally rarely use horizontal splits unless I already have loads of windows open already.

I know there are workarounds but they all have their downsides. The one suggested by @justinmk is too general and forces all windows to be vertical, including when specifically telling the window to be horizontal. For helpfiles I currently use the following configuration as a workaround, but it doesn't work 100% of the time as I sometimes get weird behaviour because of it, for insance when clashing with plugins.

augroup vertical_help
  autocmd!
  autocmd FileType help
        \ setlocal bufhidden=unload |
        \ wincmd L |
        \ vertical resize 79
augroup END

@neovim neovim deleted a comment from Antonio-Bennett Sep 24, 2021
@neovim neovim locked as off-topic and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement feature request has:plan has:vim-patch issue is fixed in vim and patch needs to be ported has:workaround issue is not fixed but can be circumvented until then
Projects
None yet
Development

No branches or pull requests

7 participants