简体   繁体   中英

What is a “buffer” in VIM?

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.

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.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM