Listing your open buffers
It’s easy to lose track of which buffers are loaded. So, Vim provides a command for listing them: :ls.
There are three other files alongside the editor’s exercise.txt: a.txt, b.txt, and c.txt.
Work through the checklist below: list your buffers while only exercise.txt is loaded, open each of the other files with :e, then list the buffers again to see everything you’ve collected. After showing the list, Vim waits for you to press Enter before returning you to your file.
1 2 3 4 5
List your open buffers Only exercise.txt is loaded so far — type :ls and hit Enter, then hit Enter again to leave the list.
Open a.txt The statusline will show the new name — type :e a.txt and hit Enter.
Open b.txt Same again — type :e b.txt and hit Enter.
Open c.txt One more — type :e c.txt and hit Enter.
List the buffers again All four buffers show up this time — type :ls and hit Enter, then hit Enter again to dismiss the list.
Next: Open a.txt
Next: Open b.txt
Next: Open c.txt
Next: List the buffers again
Last one — goal check runs when it's done
Nice work!
Up next: Moving between buffers.