Search notes:

Vim: buffers

Buffers are essentially files that are loaded in vim.
Multiple windows can show a portion of the same buffer concurrently.

Buffer list

:ls, buflisted
The buffer list might be stored in a viminfo file.

Buffers in a window

What happens to a buffer when it is no longer displayed in a window is determined with bufhidden.

Alternate buffer

The name of the alternate buffer is stored in the # register

Scratch buffer

:help buffers, scrolling down to scratch says:
Contains text that can be discarded at any time.  It is kept
    when closing the window, it must be deleted explicitly.
    Settings:
      :setlocal buftype=nofile
      :setlocal bufhidden=hide
      :setlocal noswapfile
    The buffer name can be used to identify the buffer, if you
    give it a meaningful name.
bufhidden, buftype, swapfile

Special buffers

Special buffers are
The help buffer never uses a swap file.
The spell buffer is never displayed and does not have a file name.

vim internals

Linked list of buffers

The vim sources store all buffers in a linked list.
The global variables firstbuf and lastbuf, whose type is buf_T*, point to the first and last entry in this linked list (globals.h).

Currently active buffer

One (or at most one?) buffer is active. This buffer is pointed to by the global variable

See also

windows
buffer.c
The wininfo_T struct stores information that pertains to a Window stored with a buffer.

Index