Lua Mastery

Lua powers Neovim configuration and plugins. Master it to customize your editor and build powerful automation.

Why Lua Matters

Domain Applications

Neovim Configuration

init.lua, plugin configs, custom keymaps, autocommands

Plugin Development

Telescope extensions, custom commands, UI components

Scripting

Fast, embeddable scripting language

Game Development

Love2D, game engines, mod systems

Embedded Systems

Configuration for networking equipment, IoT

Curriculum

Module Description Level

Fundamentals

Variables, types, operators, control flow

Beginner

Tables

Arrays, dictionaries, nested structures

Beginner

Functions

Definitions, closures, variadic functions

Intermediate

Metatables

Operator overloading, OOP patterns

Intermediate

Modules

require, module patterns, package path

Intermediate

Coroutines

Cooperative multitasking, async patterns

Advanced

Neovim Integration

vim.*, Neovim API, plugin development

Advanced

Practical Patterns

Real patterns from domus-nvim

Reference

Quick Reference

Running Lua

# Interactive REPL
lua

# Run script
lua script.lua

# Neovim Lua
:lua print("Hello")
:luafile script.lua

Neovim Lua Path

# Config location
~/.config/nvim/init.lua

# Plugin configs
~/.config/nvim/lua/plugins/*.lua

# Custom modules
~/.config/nvim/lua/mymodule.lua

Projects

Project Description Status

domus-nvim

Personal Neovim configuration (82 plugins)

Active

Custom Plugins

Telescope extensions, status line

Planning

Key Differences from Python

Lua Python

local x = 1

x = 1

Tables for everything

Lists, dicts, tuples

1-indexed arrays

0-indexed lists

~= (not equal)

!=

.. (concatenation)

+

#table (length)

len(list)

nil

None

and / or / not

Same