Skip to content

Commit 14d67e4

Browse files
committed
Add a readme
1 parent de3391f commit 14d67e4

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.github/linters/.luacheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.luacheckrc

.luacheckrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ ignore = {
44
read_globals = {
55
"vim",
66
"describe",
7-
"it"
7+
"it",
8+
"assert"
89
}

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# nvim-lua-plugin-template
2+
3+
This repository is a template for Neovim plugins written in Lua.
4+
5+
The intention is that you use this template to create a new repository where you then adapt this readme and add your plugin code.
6+
The template includes the following:
7+
8+
- Github workflows to run linters and tests
9+
- Minimal test setup
10+
- editorconfig
11+
- A .luacheckrc
12+
13+
14+
To get started writing a Lua plugin, I recommend reading the [nvim-lua-guide][nvim-lua-guide].
15+
16+
17+
Things you should avoid:
18+
19+
- Automatically setting up global mappings. Instead prefer a `.setup {}` function where users can opt-in to default mappings, or let them configure the mappings on their own.
20+
- To be extended ...
21+
22+
23+
The remainder of the README is text that can be preserved in your plugin:
24+
25+
---
26+
27+
28+
## Development
29+
30+
### Run tests
31+
32+
33+
Running tests requires [plenary.nvim][plenary] to be checked out in the parent directory of *this* repository.
34+
You can then run:
35+
36+
```bash
37+
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
38+
```
39+
40+
Or if you want to run a single test file:
41+
42+
```bash
43+
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/path_to_file.lua {minimal_init = 'tests/minimal.vim'}"
44+
```
45+
46+
47+
[nvim-lua-guide]: https://github.com/nanotee/nvim-lua-guide
48+
[plenary]: https://github.com/nvim-lua/plenary.nvim

0 commit comments

Comments
 (0)