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:
| 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 |
| :bdelete | remove a buffer from the buffer list | :bd [buf name] |
| :bdelete | remove a buffer from the buffer list | :bd [buf number] |
where:
- [buf name] represents the name of a buffer,
- [buf number] represents a buffer number, and
- no qualifier represents the present buffer
These commands are often bound to keymaps to provide convenient access to them, allowing buffers
to be navigated efficiently.