Skip to content

connerohnesorge/plugin-template.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plugin-template.nvim

Integration

A template to create Neovim plugins written in Lua.

Using

Clone/download it locally and change the references to my_awesome_plugin, my_cool_module accordingly to your new plugin name. Don't forget to edit the help file accordingly.

Development Environment

This project supports development with Nix Flake for a consistent, reproducible development environment.

Using Nix (Recommended)

If you have Nix with flakes enabled:

# Enter the development shell
nix develop

# Or with direnv installed
direnv allow

The Nix development shell provides:

  • Lua and LuaRocks
  • Lua Language Server (lua-language-server)
  • Code formatters (stylua, alejandra)
  • Linters (luacheck via luarocks, statix, deadnix)
  • YAML tools (yaml-language-server, actionlint)
  • Custom command dx to edit the flake.nix

Manual Setup

If not using Nix, you'll need to manually install:

Testing

This uses busted, luassert (both through plenary.nvim) and matcher_combinators to define tests in test/spec/ directory. These dependencies are required only to run tests, that's why they are installed as git submodules.

Make sure your shell is in the ./test directory or, if it is in the root directory, replace make by make -C ./test in the commands below.

To init the dependencies run

$ make prepare

To run all tests just execute

$ make test

If you have entr(1) installed you may use it to run all tests whenever a file is changed using:

$ make watch

In both commands you myght specify a single spec to test/watch using:

$ make test SPEC=spec/my_awesome_plugin/my_cool_module_spec.lua
$ make watch SPEC=spec/my_awesome_plugin/my_cool_module_spec.lua

Github actions

An Action will run all the tests and the linter on every commit on the main branch and also on Pull Request. Tests will be run using stable and nightly versions of Neovim.

About

Personal Plugin Template for Neovim Plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors