explaingit

nanotee/nvim-lua-guide

5,940Audience · developerComplexity · 1/5Setup · easy

TLDR

A community-written guide for configuring Neovim and writing plugins in Lua, covering keymaps, options, autocommands, and plugin structure, now merged into the official Neovim docs at :help lua-guide.

Mindmap

mindmap
  root((nvim-lua-guide))
    Topics covered
      init.lua setup
      Keymaps in Lua
      Autocommands
      User commands
    Neovim Lua API
      vim.opt options
      vim.api calls
      Lua modules
    Plugin writing
      Plugin structure
      LSP config
      Plugin managers
    Audience
      Neovim users
      Vimscript migrators
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how to rewrite a Vimscript Neovim config as an init.lua file using the Lua API.

USE CASE 2

Understand how to define keymaps, autocommands, and user commands in Neovim using Lua.

USE CASE 3

Use this as a reference for structuring a Neovim plugin written in Lua with proper module organization.

Tech stack

LuaNeovim

Getting it running

Difficulty · easy Time to first run · 5min

No install needed, documentation only, current content lives in Neovim built-in help at :help lua-guide.

In plain English

This repository was a community-written guide to using the Lua scripting language inside Neovim, a highly configurable text editor built on Vim. Lua became a first-class language in Neovim for writing configuration files and plugins, replacing or supplementing the older Vimscript approach. This guide was created to help users make that transition by explaining Neovim-specific Lua concepts in a clear, practical way. The guide covered topics such as how to write an init.lua configuration file, how to call Neovim's internal API from Lua, how to work with options, keymaps, autocommands, and user commands, and how to structure a plugin or personal config using Lua modules. It also explained how to interact with plugin managers and LSP configurations through Lua, which became a common setup for Neovim users. The guide gathered a wide following and became a standard starting point for developers switching from Vimscript to Lua within Neovim. Over time its content was reviewed, expanded, and eventually incorporated into the official Neovim documentation. The current README in this repository is a short notice pointing readers to the built-in help at :help lua-guide, which contains an up-to-date version of the material. The original community guide remains accessible in the repository as OLD_README.md for those who prefer reading the original text. There is no code to install or run in this repository. It is a documentation resource only.

Copy-paste prompts

Prompt 1
Using the Neovim Lua API, show me how to write an autocommand in Lua that trims trailing whitespace on every file save.
Prompt 2
Convert my Neovim init.vim config to init.lua and explain how vim.opt, vim.keymap.set, and vim.api.nvim_create_autocmd replace the Vimscript equivalents.
Prompt 3
Write a minimal Neovim plugin in Lua that adds a :Hello command, organized as a proper Lua module with a setup() function.
Prompt 4
How do I call a Neovim built-in function and read a Vim variable from Lua inside my init.lua config?
Open on GitHub → Explain another repo

← nanotee on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.