Questions tagged [split]

Questions about splitting current window into multiple viewports.

For help, check :help opening-window.

185 questions
237
votes
6 answers

How do I change the current split's width and height?

I am working on split (using ^w+v, ^w+s) buffers, but sometimes I would like to widen a current split or change its height. How can I achieve that?
Nebril
  • 3,427
  • 4
  • 16
  • 13
129
votes
4 answers

Is it possible to split Vim window to view multiple files at once?

When working with multiple files, it would be very handy if we can see more than one file in the screen at once. Is there any way in Vim to split the window (horizontally or vertically) so each split can show a different file?
thameera
  • 17,434
  • 16
  • 40
  • 42
8
votes
5 answers

How to open files in vertical splits by default?

Is there a way to make vim (or nvim) open all new splits vertically by default? There's splitright to control which side vertical splits open on, but as far as I can tell there's no built in option to make splits vertical by default. Does anyone…
Morgan May
  • 183
  • 1
  • 5
6
votes
1 answer

How to change the location of a new vertical split?

The question is somewhat straightforward. To open a vertical split, I use: :vs. When opening a vertical split, I'd like to initialize it with a file directly. If I do :vs myfile.txt this will move the file I am currently working on to the right and…
solalito
  • 363
  • 2
  • 10
5
votes
1 answer

Why are there no rightabove / leftbelow commands?

Referring to the existing leftabove and rightbelow commands, which do the following: execute a command if the command results in a split, it will be either opened on the left, or above the current window for leftabove (and analogously for…
Attilio
  • 369
  • 1
  • 6
4
votes
3 answers

Can I :split and go directly to a line?

I can open a file with vim on the command line like so: vim fnord.txt +50 And it will take me to the 50th line Is it possible to do the same thing with :split? So far I haven't been able to figure out how to do it. :split fnord.txt +50 :split…
Wayne Werner
  • 425
  • 2
  • 7
4
votes
2 answers

How to toggle between split window layouts?

I am looking for a way to toggle between these two layouts: ------- | | | ------- ------- | | ------- | | ------- I only have two windows and I need to switch the layout often. I need a solution that will preserve the aspect ratio of…
AnonymousLurker
  • 287
  • 2
  • 8
3
votes
1 answer

How do I change focus in vim split through the command mode?

I am writing a function which splits open vim in three parts but the focus shifts towards the newly opened window and I don't want that that to happen is there any way to stop this? or is there a command which does this for me so that i can insert…
3
votes
2 answers

How to make :Vex / :Hex open on the right side / below

When working on a file, I often open another file by looking for the file by opening the file browser in a vertical split with :Vex Opening the file it's actually nice to have the file browser show up on the left side, but I would like to have the…
Wolfson
  • 173
  • 1
  • 7
3
votes
1 answer

Split same file into multiple windows "extending" each other

Suppose I have a long python file which is limited to 79 character or so in width. One very helpful feature would be if I could view the whole file separated into multiple vertical splits which "extends" each other. This way, a wide monitor or…
3
votes
0 answers

:sbr opens buffers with horizontal split, even with switchbuf set to vsplit

I've set switchbuf to vsplit but when I use :sbr, vim uses a horizontal split to open the new buffer. This seems directly contrary to what :help sbr says: :sbr[ewind] [+cmd] Split window and go to first buffer in buffer list. If the buffer…
2
votes
1 answer

Set split to size of file

I have a file that is 9 lines long called foo.txt . I use :split foo.txt and the new split takes up a full 50% of the editor, which results in a lot of wasted space. I can resize it with :resize ctrl-R=line('$') but I have to type it manually each…
Joe
  • 287
  • 1
  • 9
2
votes
1 answer

Vim seamless file split with same features over the split windows

I have been searching for a way to do the following but haven't found exactly what I need, not sure if it's possible. I want to be able to split a file, but have the same features over the two splits as if I was in a single pane. Let me give an…
riordant
  • 23
  • 2
2
votes
2 answers

Make the default behavior of split window resize consistent

I use the keybinding Ctrl+W >/< to increase/decrease width of the split window, and that works just fine when the split window is in the left. However when I switch to any split beside the one on the far left, I don't feel like this specific…
xquilt
  • 81
  • 7
1
vote
3 answers

How to Directly Go to Editor Groups?

Currently, I'm using C-wC-h-type of shortcuts to navigate through open editors. However, in VS Code, I'm also used to using shortcuts like C-1 to go to the first editor group, instead of hopping through them all until I reach the first one. Is there…
psygo
  • 135
  • 5
1
2