Skip to content
This repository was archived by the owner on Nov 30, 2025. It is now read-only.

Commit 29d9752

Browse files
authored
Move viml to lua (#1)
* chore(vendor): remove unneeded "vendor" folder * feat(makefile): rewrite makefile for allowing use lua as init file * chore(minimal_vim): remove minimal_vim.vim because we are gonna using lua * feat(minimal_init): add minimal_init.lua * ci(test): add env PLENARY_DIR on github actions * docs(README): move minimal_vim.vim to minimal_init.lua * chore(minimal_init): remove print
1 parent 8faeba3 commit 29d9752

7 files changed

Lines changed: 20 additions & 14 deletions

File tree

.github/workflows/default.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ jobs:
3030

3131
- name: run tests
3232
run: make test
33+
env:
34+
PLENARY_DIR: vendor/plenary.nvim

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
.PHONY: test prepare
1+
TESTS_INIT=tests/minimal_init.lua
2+
TESTS_DIR=tests/
23

3-
prepare:
4-
@if [ ! -d "./vendor/plenary.nvim" ]; then git clone https://github.com/nvim-lua/plenary.nvim vendor/plenary.nvim; fi
4+
.PHONY: test
55

6-
test: prepare
6+
test:
77
@nvim \
88
--headless \
99
--noplugin \
10-
-u tests/minimal_vim.vim \
11-
-c "PlenaryBustedDirectory tests/ { minimal_init = 'tests/minimal_vim.vim' }"
10+
-u ${TESTS_INIT} \
11+
-c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${TESTS_INIT}' }"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Click on `Use this template`
3838
│   └── plugin_name.lua
3939
├── README.md
4040
├── tests
41-
│   ├── minimal_vim.vim
41+
│   ├── minimal_init.lua
4242
│   └── plugin_name
4343
│   └── plugin_name_spec.lua
4444
└── vendor

tests/minimal_init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local plenary_dir = os.getenv("PLENARY_DIR") or "/tmp/plenary.nvim"
2+
local is_not_a_directory = vim.fn.isdirectory(plenary_dir) == 0
3+
if is_not_a_directory then
4+
vim.fn.system({"git", "clone", "https://github.com/nvim-lua/plenary.nvim", plenary_dir})
5+
end
6+
7+
vim.opt.rtp:append(".")
8+
vim.opt.rtp:append(plenary_dir)
9+
10+
vim.cmd("runtime plugin/plenary.vim")
11+
require("plenary.busted")

tests/minimal_vim.vim

Lines changed: 0 additions & 6 deletions
This file was deleted.

vendor/.keep

Whitespace-only changes.

vendor/plenary.nvim

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)