What configuration will let vim show the buffer/filename in the status line even when only one buffer/file is open

vim

When I have more one one file open in vim (using split-screen), each commandstatus line (the last line in the window) looks like this:

filename.txt                           73,1            4%

That's the filename on the left, with the ruler position and percentage through the file on the right (via :set ruler).

However, when I only have one buffer open, the status line looks like:

                                       73,1            4%

How can I show the filename in all circumstances, even when there is only one file open?

Best Answer

That's the status line (:help status-line). To enable it when you only have one window, add to your .vimrc:

set laststatus=2