O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Buffers

Buffers are internal representations of files. Every file you open will have a corresponding buffer. Let's open a file from the command line: vim animal_farm.py. Now, let's see a list of existing buffers:

:ls
Many commands have synonyms, and :ls is not an exception: :buffers and :files will accomplish the same thing. Pick one that's the easiest for you to remember!

Here's what the output of :ls looks like (see the bottom three lines):

The status bar shows some information about the buffers we have open (we only have one right now):

  • 1 is the buffer number, and it'll stay constant throughout the Vim session
  • % indicates that the buffer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required