In Vim's terminology, a window is a viewport onto a buffer. We can open multiple windows, each containing the same buffer, or we can load different buffers into each window.
divide window horizontally, which create two windows of equal height.
split window vertically, which produce two windows of equal width.
Note: you can repeat these commands as often as you like, splitting your workspace again and again in a process that resembles cell division.
Note: Each time we use the <C-w>s
and <C-w>v
commands, the two resulting split windows will contain the same buffer as the original window was divided.
load another buffer into the active window.
divide our workspace and then open another buffer in one split window while keeping the existing buffer visible in the other split.
Changing the Focus Between Windows
In fact, <C-w><C-w>
=== <C-w>w
, you can press the <Ctrl>
key and hold it while typing ww
(or wj
or any others from the table) to change the active window. It's easier to do that.
close the active window.
close all windows except the active one.