A no-nonsense template for making high-quality Neovim plugins. It has all the best opinions, pinky promise
174
stars
206
commits
Lua
primary language
Aug 26, 2026
updated
A template repository used to create Neovim plugins.
[v0.11.0, v0.12.0, stable, nightly][ubuntu-latest, macos-latest, windows-latest]doc/news.txtmake download-dependencies so all the Lua LSP features work as expected.{
"ColinKennedy/nvim-best-practices-plugin-template",
dependencies = { "ColinKennedy/mega.cmdparse", "ColinKennedy/mega.logging" },
-- TODO: (you) - Make sure your first release matches v1.0.0 so it auto-releases!
version = "v1.*",
}
(These are default values)
{
"ColinKennedy/nvim-best-practices-plugin-template",
config = function()
vim.g.plugin_template_configuration = {
commands = {
goodnight_moon = { read = { phrase = "A good book" } },
hello_world = {
say = { ["repeat"] = 1, style = "lowercase" },
},
},
logging = {
level = "info",
use_console = false,
use_file = false,
},
tools = {
lualine = {
arbitrary_thing = {
color = "Visual",
text = " Arbitrary Thing",
},
copy_logs = {
color = "Comment",
text = " Copy Logs",
},
goodnight_moon = {
color = "Question",
text = " Goodnight moon",
},
hello_world = {
color = "Title",
text = " Hello, World!",
},
},
telescope = {
goodnight_moon = {
{ "Foo Book", "Author A" },
{ "Bar Book Title", "John Doe" },
{ "Fizz Drink", "Some Name" },
{ "Buzz Bee", "Cool Person" },
},
hello_world = { "Hi there!", "Hello, Sailor!", "What's up, doc?" },
},
},
}
end
}
Note: You can customize lualine colors here or using
vim.g.plugin_template_configuration.
require("lualine").setup {
sections = {
lualine_y = {
-- ... Your other configuration ...
{
"plugin_template",
-- NOTE: These will override default values
-- display = {
-- goodnight_moon = {color={fg="#FFFFFF"}, text="Custom message 1"}},
-- hello_world = {color={fg="#333333"}, text="Custom message 2"},
-- },
},
}
}
}
Note: You can customize telescope colors here or using
vim.g.plugin_template_configuration.
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
config = function()
-- ... Your other configuration ...
require("telescope").load_extension("plugin_template")
end,
dependencies = {
"ColinKennedy/nvim-best-practices-plugin-template",
"nvim-lua/plenary.nvim",
},
version = "0.1.*",
},
This plugin provides two default highlights
PluginTemplateTelescopeEntryPluginTemplateTelescopeSecondaryBoth come with default colors that should look nice. If you want to change them, here's how:
vim.api.nvim_set_hl(0, "PluginTemplateTelescopeEntry", {link="Statement"})
vim.api.nvim_set_hl(0, "PluginTemplateTelescopeSecondary", {link="Question"})
Here are some example commands:
" A typical subcommand
:PluginTemplate hello-world say phrase "Hello, World!" " How are you?"
:PluginTemplate hello-world say phrase "Hello, World!" --repeat=2 --style=lowercase
" An example of a flag this repeatable and 3 flags, -a, -b, -c, as one dash
:PluginTemplate arbitrary-thing -vvv -abc -f
" Separate commands with completely separate, flexible APIs
:PluginTemplate goodnight-moon count-sheep 42
:PluginTemplate goodnight-moon read "a book"
:PluginTemplate goodnight-moon sleep -z -z -z
Run this line once before calling any busted command
eval $(luarocks path --lua-version 5.1 --bin)
Run all tests
# Using the package manager
luarocks test --test-type busted
# Or manually
busted .
# Or with Make
make test
Run test based on tags
busted . --tags=simple
Making sure that your plugin is well tested is important.
nvim-best-practices-plugin-template can generate a per-line breakdown of exactly where
your code is lacking tests using LuaCov.
Make sure to install all dependencies for the unittests + coverage reporter if you have not installed them already.
luarocks install busted --local
luarocks install luacov --local
luarocks install luacov-multiple --local
make coverage-html
This will generate a luacov.stats.out & luacov_html/ directory.
(cd luacov_html && python -m http.server)
If it worked, you should see a message like
"Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000) ..."
Open http://0.0.0.0:8000 in a browser like
Firefox and you should see a view like this:
Just navigate down a few folders until you get to a .lua file and you'll see a breakdown of your line coverage like this:
See doc/news.txt for updates.
You can watch this plugin for changes by adding this URL to your RSS feed:
https://github.com/ColinKennedy/nvim-best-practices-plugin-template/commits/main/doc/news.txt.atom
This template is full of various features. But if your plugin is only meant to be a simple plugin and you don't want the bells and whistles that this template provides, consider instead using nvim-plugin-template
Lua
98.4%
Makefile
1.6%
A no-nonsense template for making high-quality Neovim plugins. It has all the best opinions, pinky promise
174
stars
206
commits
Lua
primary language
Aug 26, 2026
updated
A template repository used to create Neovim plugins.
[v0.11.0, v0.12.0, stable, nightly][ubuntu-latest, macos-latest, windows-latest]doc/news.txtmake download-dependencies so all the Lua LSP features work as expected.{
"ColinKennedy/nvim-best-practices-plugin-template",
dependencies = { "ColinKennedy/mega.cmdparse", "ColinKennedy/mega.logging" },
-- TODO: (you) - Make sure your first release matches v1.0.0 so it auto-releases!
version = "v1.*",
}
(These are default values)
{
"ColinKennedy/nvim-best-practices-plugin-template",
config = function()
vim.g.plugin_template_configuration = {
commands = {
goodnight_moon = { read = { phrase = "A good book" } },
hello_world = {
say = { ["repeat"] = 1, style = "lowercase" },
},
},
logging = {
level = "info",
use_console = false,
use_file = false,
},
tools = {
lualine = {
arbitrary_thing = {
color = "Visual",
text = " Arbitrary Thing",
},
copy_logs = {
color = "Comment",
text = " Copy Logs",
},
goodnight_moon = {
color = "Question",
text = " Goodnight moon",
},
hello_world = {
color = "Title",
text = " Hello, World!",
},
},
telescope = {
goodnight_moon = {
{ "Foo Book", "Author A" },
{ "Bar Book Title", "John Doe" },
{ "Fizz Drink", "Some Name" },
{ "Buzz Bee", "Cool Person" },
},
hello_world = { "Hi there!", "Hello, Sailor!", "What's up, doc?" },
},
},
}
end
}
Note: You can customize lualine colors here or using
vim.g.plugin_template_configuration.
require("lualine").setup {
sections = {
lualine_y = {
-- ... Your other configuration ...
{
"plugin_template",
-- NOTE: These will override default values
-- display = {
-- goodnight_moon = {color={fg="#FFFFFF"}, text="Custom message 1"}},
-- hello_world = {color={fg="#333333"}, text="Custom message 2"},
-- },
},
}
}
}
Note: You can customize telescope colors here or using
vim.g.plugin_template_configuration.
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
config = function()
-- ... Your other configuration ...
require("telescope").load_extension("plugin_template")
end,
dependencies = {
"ColinKennedy/nvim-best-practices-plugin-template",
"nvim-lua/plenary.nvim",
},
version = "0.1.*",
},
This plugin provides two default highlights
PluginTemplateTelescopeEntryPluginTemplateTelescopeSecondaryBoth come with default colors that should look nice. If you want to change them, here's how:
vim.api.nvim_set_hl(0, "PluginTemplateTelescopeEntry", {link="Statement"})
vim.api.nvim_set_hl(0, "PluginTemplateTelescopeSecondary", {link="Question"})
Here are some example commands:
" A typical subcommand
:PluginTemplate hello-world say phrase "Hello, World!" " How are you?"
:PluginTemplate hello-world say phrase "Hello, World!" --repeat=2 --style=lowercase
" An example of a flag this repeatable and 3 flags, -a, -b, -c, as one dash
:PluginTemplate arbitrary-thing -vvv -abc -f
" Separate commands with completely separate, flexible APIs
:PluginTemplate goodnight-moon count-sheep 42
:PluginTemplate goodnight-moon read "a book"
:PluginTemplate goodnight-moon sleep -z -z -z
Run this line once before calling any busted command
eval $(luarocks path --lua-version 5.1 --bin)
Run all tests
# Using the package manager
luarocks test --test-type busted
# Or manually
busted .
# Or with Make
make test
Run test based on tags
busted . --tags=simple
Making sure that your plugin is well tested is important.
nvim-best-practices-plugin-template can generate a per-line breakdown of exactly where
your code is lacking tests using LuaCov.
Make sure to install all dependencies for the unittests + coverage reporter if you have not installed them already.
luarocks install busted --local
luarocks install luacov --local
luarocks install luacov-multiple --local
make coverage-html
This will generate a luacov.stats.out & luacov_html/ directory.
(cd luacov_html && python -m http.server)
If it worked, you should see a message like
"Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000) ..."
Open http://0.0.0.0:8000 in a browser like
Firefox and you should see a view like this:
Just navigate down a few folders until you get to a .lua file and you'll see a breakdown of your line coverage like this:
See doc/news.txt for updates.
You can watch this plugin for changes by adding this URL to your RSS feed:
https://github.com/ColinKennedy/nvim-best-practices-plugin-template/commits/main/doc/news.txt.atom
This template is full of various features. But if your plugin is only meant to be a simple plugin and you don't want the bells and whistles that this template provides, consider instead using nvim-plugin-template
Lua
98.4%
Makefile
1.6%