I want to get the line number by a mark, is it possible to do it in nvim in Lua? I have searched the doc for mark but I cannot find anything useful.
You can use
:h nvim_buf_get_mark() line this:
local r, c = unpack(vim.api.nvim_buf_get_mark(0, "a")) print(string.format("row: [%d], col: [%d]", r, c))
The first argument is the reference to the buffer (
0 is the current buffer) and the second argument is the name of the mark.