One of the basic skills for effective editing in Vim is managing and navigating buffers.
Command | Action | Pattern |
---|---|---|
:ls | list all buffers | |
:bfirst | go to first buffer in the buffer list | :bf |
:bprevious | go to previous buffer in the buffer list | :bp |
:bnext | go to next buffer in the buffer list | :bn |
:blast | go to last buffer in the buffer list | :bl |
:bmodified | go to next buffer in the buffer list that has been modified | :bm |
:buffer# | Switch to alternate buffer | b# |
:bdelete | remove a buffer from the buffer list | :bd [ | | ]
where:
-
represents the name of a buffer, and
-
represents a buffer number