A beginner guide on writing Neovim plugins in Lua.
Overview
In Part 1 of the article, I developed a very simple Neovim plugin. In this article let’s explore Neovim Lua's libraries and use them to enhance the plugin.
Development Setup
Let’s get started by setting up a proper plugin development environment.
Help
Type :nvim_
followed tab and you should be able to see the Neovim built-in Lua APIs. However, navigating the help documentation is a bit cumbersome so let’s set up LSP.
Telescope. nvim
If you install telescope.nvim
, type :Telescope help_tags
and you can easily search for the Neovim APIs that you need.
Lua Language Server — sumneko_lua
Set up Lua language server following the instructions here.
luadev.nvim
For this tutorial, I am going to use luadev.nvim
.luadev.nvim
enables development setup for init.lua
and plugin development with full signature…