A window provides a view into a buffer, allowing you to see and
modify the text in the buffer.
There may be multiple windows associated with the same buffer.
Changes made to the buffer in one window are reflected in any
other windows open on the same buffer.
A buffer may also have no windows associated with it. In this
case, you can't do a whole lot with the buffer, although
you can open a window on it later. Closing the last window open
on a buffer effectively "hides" the file.
If the buffer has been modified but not written to disk,
the editor may or may not let you close the last window that's
open on it.
When you create a new window, the editor splits the current screen.
For most of the editors,
you create a new window which shows another view on the
file you're currently editing. You then switch to the window where
you wish to edit the next file, and instruct the editor to start
editing the file there. Each editor provides vi
and ex
commands to switch back and forth between windows, as well as
the ability to change the window size, and hide and restore windows.
In each editor's chapter,
we show a sample split screen
(editing the same two files), and describe
how to split the screen and move between windows.