In ViM, what is Buffer 0?

The vim buflisted(0) and bufexists(0) return true if I have one file open.

I do not understand this because the output of ls shows that the file as buffer 1 (both buflisted(1) and bufexists(1) also returns true). And if I try any buffer operation in buffer 0, I get a Zero count error message.

It looks like a special buffer, but I can not find any information that tells me what buffer 0 is used for. Can anyone help?

Thanks!

+6
source share
1 answer

This 0 is explained in :help bufname() . This is the "alternate buffer" of the current buffer.

+5
source

All Articles