- Lua 73%
- Makefile 15%
- Shell 12%
Nvim Plugin Template
Bootstrap · Prerequisites · Install · Usage · Development
Neovim Plugin template (plugin.nvim) is a template repository for bootstrapping a neovim plugin.
Create a new plugin from this template #
# 1. click "Use this template" on GitHub, then clone your new repo
git clone https://github.com/<you>/<your-plugin>.nvim
cd <your-plugin>.nvim
# 2. rename the template to your plugin (lua module, command, README, plugin.json)
make rename NAME=<you>/<your-plugin>.nvim
# 3. verify everything passes
make
Prerequisites #
Tests auto-bootstrap plenary.nvim on first run, so you don't need to install it manually.
Install #
-- Lazy plugin spec
{
"marco-souza/plugin.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
config = function()
require("plugin").setup()
end,
},
Usage #
Install it with your plugin manager, then run the Plugin user command — it ships with a hello subcommand so you can confirm it loaded:
:Plugin hello
" -> notifies: hello from plugin.nvim!
The notes subcommand opens a sidebar note-taking app for *.md files in the current directory:
:Plugin notes " open the notes layout (sidebar 20% / main 80%)
:Plugin close " close it
In the layout: <CR> opens the file under the cursor in the sidebar; q closes the whole layout from either pane. Add a keymap if you like:
vim.keymap.set("n", "<leader>pn", "<cmd>Plugin notes<cr>")
Subcommands are defined in lua/plugin/init.lua; add your own there following the table shape in lua/cmd.lua.
Development #
make # fmt-check + lint + tests (what CI runs)
make tests # just the specs
make fmt # reformat lua/
make rename NAME=you/your-plugin.nvim # point the template at your repo
plugin.jsonholds the version read by thetag-releaseworkflow; bumpversionto cut a release.
License #
MIT