Neovim Plugin Development
This skill provides patterns and best practices for Neovim plugin development.
Read the reference files below on demand based on the current task.
Reference Files
Read these on demand based on the task. Do NOT load all three at once.
Each file has a table of contents at the top with anchors for navigation.
references/RECIPES.md
Complete code examples for every plugin pattern.
- Project Structure
- Setup & Configuration
- Module Organization
- Plugin File (user commands, lazy loading)
- Highlight Groups
- Autocmds
- Keymaps
- Health Checks
- Error Handling & Notifications
- Type Annotations
- Debounce
- State Management (per-buffer cache)
- User Commands (subcommands with completion)
- Anti-Patterns
references/TYPES.md
LuaCATS type annotation reference for Neovim plugins.
- Quick Start (minimum annotations every plugin needs)
- Type Syntax Reference (primitives, compound types, Neovim-specific)
- Annotation Tags — Complete Reference (@class, @field, @type, @alias, @enum, @param, @return, @generic, @overload, @operator, @cast, visibility modifiers)
- Neovim Plugin Type Patterns (autocmd callbacks, keymaps, highlights, buffers, LSP, commands)
- Definition Files (@meta)
- Config Type Patterns (separate classes vs partial)
- Diagnostic Configuration (.luarc.json settings)
references/TESTS.md
Testing patterns for writing and implementing tests (mini.test + luassert).
For running tests and diagnosing failures, use the nvim-test skill.
- Test File Structure
- Assertions Quick Reference
- Table-Driven Tests
- Stubbing and Restoring
- Creating Test Buffers
- Testing with File Buffers
- Testing Config Changes
- Conditional Tests
- Testing Notifications
- Testing Highlights
- Testing Autocmds
- Testing Keymaps
- Test Anti-Patterns
- Advanced Testing Patterns
Working with existing plugins
When modifying an existing plugin:
- Read the existing code first — match the project's conventions
- Check
CONTRIBUTING.md and AGENTS.md for project-specific rules
- Look at existing
_spec.lua files to match testing style
- Look at existing highlight/autocmd patterns and be consistent
File locations in this project
- Plugin source:
lua/base/
- Tests:
tests/
- Plugin commands:
plugin/base.lua
- Documentation:
doc/base.txt
Source: S1M0N38/base.nvim — distributed by TomeVault.
1---2name: s1m0n38-base-nvim-base-nvim3description: Neovim Plugin Development4---56# Neovim Plugin Development78This skill provides patterns and best practices for Neovim plugin development.9Read the reference files below on demand based on the current task.1011## Reference Files1213Read these on demand based on the task. Do NOT load all three at once.14Each file has a table of contents at the top with anchors for navigation.1516### `references/RECIPES.md`17Complete code examples for every plugin pattern.18191. Project Structure202. Setup & Configuration213. Module Organization224. Plugin File (user commands, lazy loading)235. Highlight Groups246. Autocmds257. Keymaps268. Health Checks279. Error Handling & Notifications2810. Type Annotations2911. Debounce3012. State Management (per-buffer cache)3113. User Commands (subcommands with completion)3214. Anti-Patterns3334### `references/TYPES.md`35LuaCATS type annotation reference for Neovim plugins.36371. Quick Start (minimum annotations every plugin needs)382. Type Syntax Reference (primitives, compound types, Neovim-specific)393. Annotation Tags — Complete Reference (@class, @field, @type, @alias, @enum, @param, @return, @generic, @overload, @operator, @cast, visibility modifiers)404. Neovim Plugin Type Patterns (autocmd callbacks, keymaps, highlights, buffers, LSP, commands)415. Definition Files (@meta)426. Config Type Patterns (separate classes vs partial)437. Diagnostic Configuration (.luarc.json settings)4445### `references/TESTS.md`46Testing patterns for writing and implementing tests (mini.test + luassert).47For running tests and diagnosing failures, use the `nvim-test` skill.48491. Test File Structure502. Assertions Quick Reference513. Table-Driven Tests524. Stubbing and Restoring535. Creating Test Buffers546. Testing with File Buffers557. Testing Config Changes568. Conditional Tests579. Testing Notifications5810. Testing Highlights5911. Testing Autocmds6012. Testing Keymaps6113. Test Anti-Patterns6214. Advanced Testing Patterns6364## Working with existing plugins6566When modifying an existing plugin:67681. Read the existing code first — match the project's conventions692. Check `CONTRIBUTING.md` and `AGENTS.md` for project-specific rules703. Look at existing `_spec.lua` files to match testing style714. Look at existing highlight/autocmd patterns and be consistent7273## File locations in this project7475- Plugin source: `lua/base/`76- Tests: `tests/`77- Plugin commands: `plugin/base.lua`78- Documentation: `doc/base.txt`7980---81> Source: [S1M0N38/base.nvim](https://github.com/S1M0N38/base.nvim) — distributed by [TomeVault](https://tomevault.io).82<!-- tomevault:4.0:skill_md:2026-06-19 -->