Navigating Buffers

An editing session often requires having several buffers open simultaneously, which may or may not be contained in separate windows. Neovim provides a variety of ways to navigate between Buffers, allowing one to edit multiple Buffers efficiently.

Here is a quick summary of some of the command-line commands that can be used to navigate between Buffers:

CommandActionPattern
:lslist all buffers
:bfirstgo to first buffer in the buffer list:bf
:bpreviousgo to previous buffer in the buffer list:bp
:bnextgo to next buffer in the buffer list:bn
:blastgo to last buffer in the buffer list:bl
:bmodifiedgo to next buffer in the buffer list that has been modified:bm
:buffer#Switch to alternate bufferb#
:bdeleteremove a buffer from the buffer list:bd [text_fields|numbers]

where:

  • text_fields represents the name of a buffer, and

  • numbers represents a buffer number

These commands are often bound to keymaps to provide convenient access to them, allowing buffers to be navigated efficiently.