11

Is it possible, in one instance of VIM, to open one file in few buffers and edit them independently?

Ivan
  • 336
  • 4
  • 12

1 Answers1

19

I'm not sure about what you mean by buffer.

In Vim jargon, a buffer maps a file, or a file that could be saved later. If you really want independent buffers initialized with a same file, you'll need to fill each buffer with :read path/to/filename.

Then, you'll have completely independent buffers. Saving them won't even update the initial file.

In Vim, we also have windows. A buffer may be displayed in one, or more, window(s), or even in none. If you split (horizontally) the current window with :sp (or vertically with :vsp), you'll have two (or more) windows to a same buffer. They don't need to display the same part of the buffer. Any modification to a buffer through a window will be visible in the other windows. Saving the buffer saves... the current buffer in one single file.

Luc Hermitte
  • 17,351
  • 1
  • 33
  • 49