Get The Name Of The Current File In Neovim
October 2023
local current_buffer_name = vim.api.nvim_buf_get_name(0)
print(current_buffer_name):echo nvim_buf_get_name(0)Notes
-
Where
0is for the current buffer - Can also pass a buffer number for another buffer
end of line