Working with buffers
#6
Introducing the buffer list, and commands for switching between buffers. This episode also covers the concept of ‘hidden’ buffers, and shows how to deal with them.
Working with buffers
These commands show and navigate through the buffer list:
| command | action | ||||||||
|---|---|---|---|---|---|---|---|---|---|
:ls |
show the buffer list | ||||||||
:bn |
open the next buffer in the current window (cycles from the end of the list to the beginning). | ||||||||
:bp |
open the previous buffer in the current window (cycles from the start of the list to the end). | ||||||||
CTRL-^ |
switch to the alternate file | ||||||||
| command | action |
|---|---|
:w |
save the changes to a file |
:e! |
restore the original file |
:bd! |
forcibly remove the buffer from the buffer list, discarding any changes |
:q! |
force Vim to quit, discarding changes to all modified buffers |
blog comments powered by Disqus