Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ViM what is Buffer 0?

Tags:

vim

buffer

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

I don't understand this because the output of ls shows that file as buffer 1 (and buflisted(1) and bufexists(1) also returns true). And if I try any buffer operation on buffer 0 I get the error message Zero count.

This seems like a special buffer but I can't find any information that tells me what buffer 0 is used for. Can anybody help?

Thanks!

like image 622
E.Beach Avatar asked Nov 16 '12 20:11

E.Beach


1 Answers

That 0 is explained in :help bufname(). It's the "alternate buffer" of the current buffer.

like image 180
romainl Avatar answered Sep 30 '22 14:09

romainl