I looked at the official API page: https://neovim.io/doc/user/api.html, but it doesn’t seem to have all the functions I can call to write functions in init.lua
. I got this answer on Vi StackExchange with a lua snippet that calls vim.fn.line()
. What is it and where is it documented? and what are other things I should know about Neovim Lua / APIs?
Any function that you can call in vimscript you can call from lua using vim.fn.
prefix. To get help for function In question you can run :h line()
.