Neovim 101 — Plugin Development using Lua

Develop a literate programming plugin for Neovim.

alpha2phi
5 min readDec 2, 2022
Neovim 101 — Plugin Development using Lua

We explored an interesting topic related to literate programming using the Neovim Tree-sitter and Lua APIs. This article explores how we can improve and refactor the existing code to a Neovim plugin.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this repository.

Getting Started

We developed a literate programming Lua module to generate code output from within a Markdown document.

Literate Programming using Neovim

This article enhances the Lua module to support more languages and user commands.

Let’s see how it works.

Run Python Code Snippets

We can generate code output for Python using the :LpRun python command.

Generate Python Code Output

Run JavaScript Code Snippets

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.