Creating Splits

Open more than one viewport onto the same workspace.

Keys: Ctrl-W s, Ctrl-W v, :sp, :vs

Ctrl-Ws splits the current window horizontally; Ctrl-Wv splits vertically. :sp and :vs do the same and can take a filename to open in the new split.

A window is a viewport. Splits give you more than one. Ctrl-Ws stacks two viewports vertically (a horizontal split). Ctrl-Wv puts them side by side (a vertical split).

Horizontal split (top/bottom)
KeyNote
{key:Ctrl-W}
s
Vertical split (left/right)
KeyNote
{key:Ctrl-W}
v
Horizontal split, open {file}
KeyNote
:
s
p
{file}
Enter
Vertical split, open {file}
KeyNote
:
v
s
{file}
Enter
Ctrl-W s โ€” horizontal split
Ctrl-W v โ€” vertical split

Worked example โ€” :split and :vsplit

Two views of one buffer (or two).

Step 1 ยท
[missing screenshot windows.splits/frame_01.color.svg โ€” run python content/render_screenshots.py]
Step 2 ยท :sp ยท :sp โ€” horizontal split.
[missing screenshot windows.splits/frame_02.color.svg โ€” run python content/render_screenshots.py]
Step 3 ยท :vsp ยท :vsp โ€” vertical split.
[missing screenshot windows.splits/frame_03.color.svg โ€” run python content/render_screenshots.py]

Each split is an independent view. Use Ctrl-W h/j/k/l to navigate.

Watch

See also: Navigating Windows, Move and Resize Windows, Buffer vs Window vs Tab