Codeberg Mirror | GitHub Mirror
Important
This was NOT AI-generated!
An annotated Neovim plugin template with pre-commit, StyLua and selene configs,
with some useful GitHub actions included.
- A dynamic install script
generate.sh(see Setup) - Plenty of utilities you can use with your plugin (
util.lua) - Pre-documented Lua code
- Optional template file for
:checkhealth(health.lua) - Optional Python 3 component (
rplugin/python3/my-plugin.py, DOCUMENTED) - Optional unit testing using
busted(spec/) - CI utilities supported:
pre-commitconfig (.pre-commit-config.yaml)- StyLua config (
stylua.toml) seleneconfig (selene.toml,vim.yml)- A bunch of useful GitHub Actions (see
.github/workflows)
Note
The script is subject to breaking changes in the future. Therefore please review the instructions below.
To configure the template simply run generate.sh in your terminal:
./generate.sh # Has to be run in the repository root!It'll invoke many prompts so that you may structure your plugin as desired.
The script will delete itself after a successful setup!
This template includes the following relevant files:
generate.sh <== Bash script plugin template generator
stylua.toml <== Config file for StyLua
selene.toml <== Config file for selene
vim.yml <== Std file for selene
.busted <== Config file for busted
spec/ <== Contains all the unit tests
└── my-plugin_spec.lua <== NOTE: All test files must end up with `*_spec.lua`!
lua/
├── my-plugin.lua <== The main module
├── my-plugin/ <== Folder containing all the plugin utils
│ ├── config.lua <== Configuration module. Contains your main `setup()` function
│ ├── health.lua <== Hooks for `:checkhealth` (OPTIONAL)
└ └── util.lua <== Utilities for the plugin
rplugin/
├── python3/ <== Folder containing the Python 3 components
└ └── my-plugin.py <== The Python 3 component
.github/
├── workflows/ <== Folder containing all the GitHub Actions
│ ├── selene.yml <== Workflow for selene
└ └── stylua.yml <== Workflow for StyLua