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.
generate.sh (see Setup)util.lua):checkhealth (health.lua)rplugin/python3/my-plugin.py, DOCUMENTED)busted (spec/)pre-commit config (.pre-commit-config.yaml)stylua.toml)selene config (selene.toml, vim.yml).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