Vim :buffers what %a and # mean?

9

3

What do %a and # mean in VIM :buffers window?

Vim :buffers window

Nemoden

Posted 2011-05-19T01:44:47.467

Reputation: 2 007

Answers

10

That information is contained in ":help :buffers". I will quote it here:

Indicators (chars in the same column are mutually exclusive):
u   an unlisted buffer (only displayed when [!] is used)
       |unlisted-buffer|
 %  the buffer in the current window
 #  the alternate buffer for ":e #" and CTRL-^
  a an active buffer: it is loaded and visible
  h a hidden buffer: It is loaded, but currently not
       displayed in a window |hidden-buffer|
   -    a buffer with 'modifiable' off
   =    a readonly buffer
    +   a modified buffer
    x   a buffer with read errors

So to answer your specific question, "%" means the current buffer in the window your cursor is in when you did ":buffers". "a" means a buffer you can currently see. Finally, "#" is the alternate buffer, which usually means the last buffer you were editing.

Heptite

Posted 2011-05-19T01:44:47.467

Reputation: 16 267

5

In addition, # and % are substituted for literal filenames when executing files. For example, when editing a Python file, if you type :!python %, it executes the current file as a Python file. Similarly, replacing % with # executes the alternate file. Very useful. :)

varun

Posted 2011-05-19T01:44:47.467

Reputation: 151