Nvim Plugin Template
Neovim Plugin template (`plugin.nvim`) is a template repository for bootstrapping a neovim plugin.
## Create a new plugin from this template
```sh
# 1. click "Use this template" on GitHub, then clone your new repo
git clone https://github.com//.nvim
cd .nvim
# 2. rename the template to your plugin (lua module, command, README, plugin.json)
make rename NAME=/.nvim
# 3. verify everything passes
make
```
## Prerequisites
- [Neovim](https://github.com/neovim/neovim/releases) (0.9+)
- [stylua](https://github.com/JohnnyMorganz/StyLua) — formatting
- [luacheck](https://github.com/mpeterv/luacheck) — linting
- `make`, `git`, `perl`
Tests auto-bootstrap [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) on first run, so you don't need to install it manually.
## Install
```lua
-- 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:
```vim
:Plugin hello
" -> notifies: hello from plugin.nvim!
```
The `notes` subcommand opens a sidebar note-taking app for `*.md` files in the current directory:
```vim
:Plugin notes " open the notes layout (sidebar 20% / main 80%)
:Plugin close " close it
```
In the layout: `` opens the file under the cursor in the sidebar; `q` closes the whole layout from either pane. Add a keymap if you like:
```lua
vim.keymap.set("n", "pn", "Plugin notes")
```
Subcommands are defined in `lua/plugin/init.lua`; add your own there following the table shape in `lua/cmd.lua`.
## Development
```sh
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.json` holds the version read by the `tag-release` workflow; bump `version` to cut a release.
## License
MIT