Writing Neovim Plugins — A Beginner Guide (Part 2)

alpha2phi
5 min readMay 31, 2021

A beginner guide on writing Neovim plugins in Lua.

Writing Neovim Plugins

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.

telescope.nvim Help

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…

--

--

alpha2phi
alpha2phi

Written by alpha2phi

Software engineer, Data Science and ML practitioner.

Responses (1)