all repos

gopher.nvim @ 3d49d58fd24c5a6aecedf8e8829aa7b2f5c01b2a

Minimalistic plugin for Go development
4 files changed, 36 insertions(+), 6 deletions(-)
feat: run tests independent from user's nvim config
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2023-07-20 00:18:13 +0300
Parent: bc3ce34
M .gitignore

@@ -1,1 +1,2 @@

-playground/ +/playground/ +/.tests/
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"
D

@@ -1,4 +0,0 @@

-set rtp+=. -packadd plenary.nvim -packadd nvim-treesitter -packadd nvim-dap