Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim:what's the difference between buffers and args

I'm using vim,when I see the :args command ,I don't know the difference between args and buffers. in vim,I know buffers is important, so I thought :arg* is not important,maybe it's a "legacy command", but when I play the vim genius game ,I see arg*

someone have any idea? I'm sorry for my poor English! thx!

like image 352
Sailor Avatar asked Dec 24 '14 14:12

Sailor


People also ask

What are buffers in Vim?

A buffer is an area of Vim's memory used to hold text read from a file. In addition, an empty buffer with no associated file can be created to allow the entry of text. The :e filename command can edit an existing file or a new file.

Why does the vi editor use buffers?

Whenever you delete something from a file, vi keeps a copy in a temporary file called the general buffer. You can also delete or copy lines into temporary files called named buffers that will let you reuse those lines during your current vi work session.

How do I close Vim buffers?

Close buffer named Name (as shown by :ls ). Assuming the default backslash leader key, you can also press \bd to close (delete) the buffer in the current window (same as :Bclose ).

What is set hidden in Vim?

In a nutshell, by allowing hidden buffers with set hidden , you're telling Vim that you can have unsaved worked that's not displayed on your screen. You can see an example of this in the video below. That's Vim's way of saying you can't open a new buffer (and hide this one) without first writing it.


1 Answers

What is a Vim buffer?

A buffer is a file loaded into memory for editing. All opened files are associated with a buffer.

How do I identify a buffer?

Vim buffers are identified using a name and a number. The name of the buffer is the name of the file associated with that buffer. The buffer number is a unique sequential number assigned by Vim. This buffer number will not change in a single Vim session

The argument list is a subset of the buffer list. If you've just launched Vim, then the buffer list will be relatively empty.

Buffer List ==> files in vim buffers

Args List ==> files open at the dos/linux command line or open from the vim command line using :args (example open all c files in current directory :args *.c)

Here is a more detailed description and useful tips Buffer List v Argument List

like image 143
gpullen Avatar answered Nov 09 '22 19:11

gpullen