File tree Expand file tree Collapse file tree 10 files changed +106
-0
lines changed
Expand file tree Collapse file tree 10 files changed +106
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ on : [push, pull_request]
3+
4+ jobs :
5+ stylua :
6+ name : stylua
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v2
10+ - uses : JohnnyMorganz/stylua-action@1.0.0
11+ with :
12+ token : ${{ secrets.GITHUB_TOKEN }}
13+ args : --color always --check .
14+
15+ test :
16+ runs-on : ubuntu-latest
17+ strategy :
18+ matrix :
19+ nvim-versions : ['stable', 'nightly']
20+ name : test
21+ steps :
22+ - name : checkout
23+ uses : actions/checkout@v2
24+
25+ - uses : rhysd/action-setup-vim@v1
26+ with :
27+ neovim : true
28+ version : ${{ matrix.nvim-versions }}
29+
30+ - name : run tests
31+ run : make test
Original file line number Diff line number Diff line change 1+ [submodule "vendor/plenary.nvim "]
2+ path = vendor/plenary.nvim
3+ url = https://github.com/nvim-lua/plenary.nvim.git
Original file line number Diff line number Diff line change 1+ column_width = 120
2+ line_endings = " Unix"
3+ indent_type = " Spaces"
4+ indent_width = 2
5+ quote_style = " AutoPreferDouble"
6+ no_call_parentheses = false
Original file line number Diff line number Diff line change 1+ .PHONY : test prepare
2+
3+ prepare :
4+ @git submodule update --depth 1 --init
5+
6+ test : prepare
7+ @nvim \
8+ --headless \
9+ --noplugin \
10+ -u tests/minimal_vim.vim \
11+ -c " PlenaryBustedDirectory tests/ { minimal_init = 'tests/minimal_vim.vim' }"
Original file line number Diff line number Diff line change 1+ # A Neovim Plugin Template
2+
3+ ![ GitHub Workflow Status] ( https://img.shields.io/github/workflow/status/ellisonleao/neovim-plugin-template/default?style=for-the-badge )
4+ ![ Lua] ( https://img.shields.io/badge/Made%20with%20Lua-blueviolet.svg?style=for-the-badge&logo=lua )
5+
6+ A template repository for Neovim plugins.
7+
8+ ## Using it
9+
10+ Via ` gh ` :
11+
12+ ```
13+ $ gh repo create my-plugin -p ellisonleao/neovim-plugin-template
14+ ```
15+
16+ Via github web page:
17+
18+ Click on ` Use this template `
19+
20+ ![ ] ( https://docs.github.com/assets/cb-36544/images/help/repository/use-this-template-button.png )
21+
22+ ## Features and structure
23+
24+ - 100% lua
25+ - Github actions to run tests and formatting (Stylua)
26+ - tests with busted and plenary.nvim
27+
28+ ### Plugin structure
29+
30+ ```
31+
32+ ```
Original file line number Diff line number Diff line change 1+ -- module represents a lua module for the plugin
2+ local M = {}
3+
4+ M .my_first_function = function ()
5+ return " my first function"
6+ end
7+
8+ return M
Original file line number Diff line number Diff line change 1+ vim .cmd ([[ command! MyFirstFunction lua require('module').my_first_function() ]] )
Original file line number Diff line number Diff line change 1+ set rtp += .
2+ set rtp += vendor/plenary.nvim
3+
4+ runtime plugin /plenary.vim
5+
6+ lua require (' plenary.busted' )
Original file line number Diff line number Diff line change 1+ local module = require (" module" )
2+
3+ describe (" my function" , function ()
4+ it (" works!" , function ()
5+ assert .are .equal (" my first function" , module .my_first_function ())
6+ end )
7+ end )
You can’t perform that action at this time.
0 commit comments