DEV Community

Connor Bode
Connor Bode

Posted on

Buffers in VIM

Buffers are essential knowledge in VIM.

A buffer represents an open file. If you know how to manipulate buffers, you'll easily be able to switch between files.

There are three essential things to know.

  • :badd <file> will open <file> into a new buffer.
  • :ls will list open buffers.
  • :b <buffer_number> will open <buffer_number> into the current window.

That's all you need for buffer basics. If you want to close out a buffer, you can open it into the current window and use :q. Alternatively, you can use :bdelete <buffer_number>.


Follow me here on dev.to or on Twitter @connorbode for more quick tips!

Top comments (0)