Home

Get The Buffer Number Of A Buffer In A Neovim Window With Lua

Getting The Buffer Number

Use this to get the buffer number of the buffer in a specific window:

Where `WINDOW_NUMBER`` is the number of the window you want to get the buffer number for. It can be set to zero to get the buffer number of the current window.

To see the value on the command line, use:

The Current Window Number

You can find the window number of the current window with:

Which is used like this on the command line