By default, Vim will refuse to replace the current buffer with another one if it contains unsaved changes. You'll need to add the option below to your vimrc
if you don't want that behavior (and you don't want that):
set hidden
Buffers are Vim's equivalent of documents in other programs. When you switch to another document, you switch to another buffer. This is done with commands like:
:b2 switch to buffer number 2
:b# switch to previous buffer
:b foo<tab> switch to buffer with foo in its name + tab completion
...
Windows are a limited abstraction built on top of buffers. They are viewports used to display buffers but they are not and can't be tied to any specific buffer. Switching to a window or closing a window are definitely not the same as switching to buffer or closing a buffer. You can work with windows with the commands listed under :help ctrl-w
:
<C-w>s split current window in two, focus on the new one
<C-w>c close the current window
<C-w>o closes all other windows
<C-w>p switch to previous window
...
Tab pages are another limited abstraction built on windows. They are workspaces designed to contain one or more windows. Like windows, they can't be used as file/document proxies.
See :help windows
and :help tab-page
for a thorough description.
:h CTRL-W_c
,:h CTRL-W_o
.