4 files changed,
36 insertions(+),
6 deletions(-)
Author:
Smirnov Oleksandr
ss2316544@gmail.com
Committed at:
2023-07-20 00:18:13 +0300
Parent:
bc3ce34
jump to
| M | .gitignore |
| M | Taskfile.yml |
| A | spec/minimal_init.lua |
| D | spec/minimal_init.vim |
M
Taskfile.yml
@@ -23,7 +23,7 @@ aliases: [tests, spec]
cmds: - | nvim --headless \ - -u ./spec/minimal_init.vim\ + -u ./spec/minimal_init.lua\ -c "PlenaryBustedDirectory spec \ {minimal_init='./spec/minimal_init.lua'\ ,sequential=true}"
A
spec/minimal_init.lua
@@ -0,0 +1,33 @@
+local function root(p) + local f = debug.getinfo(1, "S").source:sub(2) + return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (p or "") +end + +local function install_plug(plugin) + local name = plugin:match ".*/(.*)" + local package_root = root ".tests/site/pack/deps/start/" + if not vim.loop.fs_stat(package_root .. name) then + print("Installing " .. plugin) + vim.fn.mkdir(package_root, "p") + vim.fn.system { + "git", + "clone", + "--depth=1", + "https://github.com/" .. plugin .. ".git", + package_root .. "/" .. name, + } + end +end + +vim.cmd [[set runtimepath=$VIMRUNTIME]] +vim.opt.runtimepath:append(root()) +vim.opt.packpath = { root ".tests/site" } +vim.notify = print + +install_plug "nvim-lua/plenary.nvim" +install_plug "nvim-treesitter/nvim-treesitter" + +vim.env.XDG_CONFIG_HOME = root ".tests/config" +vim.env.XDG_DATA_HOME = root ".tests/data" +vim.env.XDG_STATE_HOME = root ".tests/state" +vim.env.XDG_CACHE_HOME = root ".tests/cache"