Navigating Buffers


One of the basic skills for effective editing in Vim is managing and navigating 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