Get The Name Of The Current File In Neovim

Code
local current_buffer_name = vim.api.nvim_buf_get_name(0)
print(current_buffer_name)
Code
:echo nvim_buf_get_name(0)
Notes
  • Where `0` is for the current buffer

  • Can also pass a buffer number for another buffer