Skip to content

Commit a72ab52

Browse files
authored
Initial commit
0 parents  commit a72ab52

File tree

12 files changed

+264
-0
lines changed

12 files changed

+264
-0
lines changed

.busted

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
return {
2+
_all = {
3+
coverage = false,
4+
lpath = 'lua/?.lua;lua/?/init.lua',
5+
lua = 'nlua',
6+
},
7+
default = {
8+
verbose = true,
9+
},
10+
tests = {
11+
verbose = true,
12+
},
13+
}

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Ci
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Stylua
11+
uses: JohnnyMorganz/stylua-action@v3
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
version: latest
15+
args: --check .
16+
17+
docs:
18+
runs-on: ubuntu-latest
19+
name: pandoc to vimdoc
20+
if: ${{ github.ref == 'refs/heads/main' }}
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: panvimdoc
24+
uses: kdheepak/panvimdoc@main
25+
with:
26+
vimdoc: nvim-plugin-template.nvim
27+
treesitter: true
28+
- uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: "chore(doc): auto generate docs"
31+
commit_user_name: "github-actions[bot]"
32+
commit_user_email: "github-actions[bot]@users.noreply.github.com"
33+
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests
2+
on:
3+
pull_request: ~
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Run tests
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
neovim_version: ['nightly', 'stable']
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Download stylua
19+
shell: bash
20+
run: |
21+
wget "https://github.com/JohnnyMorganz/StyLua/releases/download/v0.18.0/stylua-linux.zip" -P /home/runner/.local/bin
22+
unzip /home/runner/.local/bin/stylua-linux.zip -d /home/runner/.local/bin
23+
chmod +x /home/runner/.local/bin/stylua
24+
- name: Run tests
25+
uses: nvim-neorocks/nvim-busted-action@v1
26+
with:
27+
nvim_version: ${{ matrix.neovim_version }}

.stylua.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
column_width = 100
2+
line_endings = "Unix"
3+
indent_type = "Spaces"
4+
indent_width = 2
5+
quote_style = "AutoPreferSingle"
6+
call_parentheses = "Always"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 nvimdev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# nvim-plugin-template
2+
3+
Neovim plugin template; includes automatic documentation generation from README, integration tests with Busted, and linting with Stylua
4+
5+
## Usage
6+
7+
1. Click `use this template` button generate a repo on your github.
8+
2. Clone your plugin repo. Open terminal then cd plugin directory.
9+
3. Run `python3 rename.py your-plugin-name`. This will replace all `nvim-plugin-template` to your `plugin-name`.
10+
Then it will prompt you input `y` or `n` to remove example codes in `init.lua` and
11+
`test/plugin_spec.lua`. If you are familiar this repo just input `y`. If you are looking at this template for the first time I suggest you inspect the contents. After this step `rename.py` will also auto-remove.
12+
13+
Now you have a clean plugin environment. Enjoy!
14+
15+
## Format
16+
17+
The CI uses `stylua` to format the code; customize the formatting by editing `.stylua.toml`.
18+
19+
## Test
20+
21+
See [Running tests locally](https://github.com/nvim-neorocks/nvim-busted-action?tab=readme-ov-file#running-tests-locally)
22+
23+
## CI
24+
25+
- Auto generates doc from README.
26+
- Runs the [nvim-busted-action](https://github.com/nvim-neorocks/nvim-busted-action) for test.
27+
- Lints with `stylua`.
28+
29+
## More
30+
31+
To see this template in action, take a look at my other plugins.
32+
33+
## License MIT

doc/.gitkeep

Whitespace-only changes.

doc/nvim-plugin-template.nvim.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
*nvim-plugin-template.nvim.txt* For NVIM v0.8.0 Last change: 2025 February 05
2+
3+
==============================================================================
4+
Table of Contents *nvim-plugin-template.nvim-table-of-contents*
5+
6+
1. nvim-plugin-template |nvim-plugin-template.nvim-nvim-plugin-template|
7+
- Usage |nvim-plugin-template.nvim-nvim-plugin-template-usage|
8+
- Format |nvim-plugin-template.nvim-nvim-plugin-template-format|
9+
- Test |nvim-plugin-template.nvim-nvim-plugin-template-test|
10+
- CI |nvim-plugin-template.nvim-nvim-plugin-template-ci|
11+
- More |nvim-plugin-template.nvim-nvim-plugin-template-more|
12+
- License MIT |nvim-plugin-template.nvim-nvim-plugin-template-license-mit|
13+
14+
==============================================================================
15+
1. nvim-plugin-template *nvim-plugin-template.nvim-nvim-plugin-template*
16+
17+
Neovim plugin template; includes automatic documentation generation from
18+
README, integration tests with Busted, and linting with Stylua
19+
20+
21+
USAGE *nvim-plugin-template.nvim-nvim-plugin-template-usage*
22+
23+
1. Click `use this template` button generate a repo on your github.
24+
2. Clone your plugin repo. Open terminal then cd plugin directory.
25+
3. Run `python3 rename.py your-plugin-name`. This will replace all `nvim-plugin-template` to your `plugin-name`.
26+
Then it will prompt you input `y` or `n` to remove example codes in `init.lua` and
27+
`test/plugin_spec.lua`. If you are familiar this repo just input `y`. If you are looking at this template for the first time I suggest you inspect the contents. After this step `rename.py` will also auto-remove.
28+
29+
Now you have a clean plugin environment. Enjoy!
30+
31+
32+
FORMAT *nvim-plugin-template.nvim-nvim-plugin-template-format*
33+
34+
The CI uses `stylua` to format the code; customize the formatting by editing
35+
`.stylua.toml`.
36+
37+
38+
TEST *nvim-plugin-template.nvim-nvim-plugin-template-test*
39+
40+
See Running tests locally
41+
<https://github.com/nvim-neorocks/nvim-busted-action?tab=readme-ov-file#running-tests-locally>
42+
43+
44+
CI *nvim-plugin-template.nvim-nvim-plugin-template-ci*
45+
46+
- Auto generates doc from README.
47+
- Runs the nvim-busted-action <https://github.com/nvim-neorocks/nvim-busted-action> for test.
48+
- Lints with `stylua`.
49+
50+
51+
MORE *nvim-plugin-template.nvim-nvim-plugin-template-more*
52+
53+
To see this template in action, take a look at my other plugins.
54+
55+
56+
LICENSE MIT *nvim-plugin-template.nvim-nvim-plugin-template-license-mit*
57+
58+
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
59+
60+
vim:tw=78:ts=8:noet:ft=help:norl:

lua/nvim-plugin-template/init.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local function example()
2+
return true
3+
end
4+
5+
return {
6+
example = example,
7+
}

plugin/nvim-plugin-template.lua

Whitespace-only changes.

0 commit comments

Comments
 (0)