Template for Neovim plugins covering the following aspects:
- Plugin directory structure
- Plugin testing
- Plugin documentation
- CI/CD pipeline
- Generating documentation from README.md
Using lazy.nvim:
return {
'tim-kuntz/plugin-template.nvim',
}
Using lazy.nvim:
- Clone the repository to ~/projects/plugin-template.nvim
- Add the following to your lazy.nvim configuration:
return {
'tim-kuntz/plugin-template.nvim',
dev = true,
enabled = true, -- false to disable plugin
}
Note that dev = true
will look for the plugin in ~/projects/plugin-template.nvim
. Setting
dev to false will use install the plugin from Github.
The specs use plenary.nvim tests.
To run the spec in the current buffer:
:PlenaryBustedFile %
To run all of the specs:
:PlenaryBustedDirectory tests
Note: The tests run in a remote nvim instance and display output in a new window in terminal mode. You may need to C-\ C-n to switch back to NORMAL mode and close the window.
Optionally, you can run the tests from the command line. Here is an ex command that opens a new terminal in a split window and runs all the tests:
:split term://nvim --headless -c 'PlenaryBustedDirectory tests'