Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Vim :buffers window

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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