New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: getting started with lua #12369
Comments
I recently wrote These are all things I discovered through
I would like to say that the Probably the most helpful thing was the |
To add to OP. The async Lua APIs in neovim are heavily callback based. Yet we don't have an out of box way of doing Thankfully, it is actually pretty easy to add some sugar on top of lua coroutines to assemble I wrote a guide for doing it here: https://github.com/ms-jpq/neovim-async-tutorial. I hope it helps :) |
@ms-jpq Does the new |
Update: https://github.com/nanotee/nvim-lua-guide is exactly what I was looking for and is actively maintained. I think it is sufficient to advertise this in |
Mention https://github.com/nanotee/nvim-lua-guide at the beginning of ":h lua" as well as ":h lua-vimscript". Closes #12369 .
Mention https://github.com/nanotee/nvim-lua-guide at the beginning of ":h lua" as well as ":h lua-vimscript". Closes neovim#12369 .
Lua integration is quickly shaping up to be the killer feature of neovim, and the upcoming LSP functionality will likely get many more people interested in customizing and extending it via Lua.
In order to make this as pleasant as possible, it would be good to have some sort of introduction to writing Lua for neovim.
This should assume familiarity with Lua (there are enough good introductions to the language around) and not replace the
:h lua
documentation; rather, it should give an overview of the fundamental ways of interacting with neovim and show what's possible: for example, addressingvim.call
,vim.fn
,vim.cmd
, and the difference between them, or when to uselua
vs.luaeval
One possibility would be adding a wiki page structured around common tasks with small examples each, such as on
(feel free to suggest others that you wish you had known when starting to write lua for neovim).
(Basically, a more comprehensive version of https://teukka.tech/luanvim.html. The advantage of an official wiki page would be discoverability via search engines. Ideally, googling
neovim autocommand lua
would lead to that page first rather than test code on github, followed by an old reddit post...)EDIT: This is pretty close to what I had in mind: https://github.com/nanotee/nvim-lua-guide
@tjdevries
The text was updated successfully, but these errors were encountered: