9

When VIM refers to a file im editing as a "buffer"...what exactly does it mean? Whenever I edit the file in shell or in the application, it refers to the copy of the file as a buffer. I was curious as to what exactly this meant, but couldn't find anything on it. Any help would be appreciated.

1

2 Answers 2

9

From :help windows-intro, as linked by icktoofay in a comment:

A buffer is the in-memory text of a file ... [which is] loaded into memory for editing. The original file remains unchanged until you write the buffer to the file.

That is, a buffer represents the actual loaded/working data itself.

4

You can think of it as similar to the Windows clipboard. You can use it to cut, copy and paste text snippets.

But you can have multiple "buffers" open at the same time. And each buffer can have a name.

See VI Tutorial: Manipulating Text:

A named buffer is another method to move or duplicate text... first position the cursor at the material you want to copy. Next make a copy of the desired text by using the yank command. This places the copied text into a temporary buffer...

2
  • 2
    @icktoofay, no wonder since in Vi terminology buffers equal to Vim registers.
    – mike3996
    Apr 1, 2012 at 9:29
  • 1
    @proto - you're absolutely correct. The term "buffer" can mean several different things. The original, "vi" meaning, was this: "vi has a total of 27 buffers where you can store text. There is one for each letter of the alphabet, and an `unnamed' buffer, which is where any text you delete goes." - lhttp://sparky.rice.edu/vi.html
    – paulsm4
    Apr 1, 2012 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.