[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang
at v0.1.5 1.0 kB view raw
1local function root(p) 2 local f = debug.getinfo(1, "S").source:sub(2) 3 return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (p or "") 4end 5 6local function install_plug(plugin) 7 local name = plugin:match ".*/(.*)" 8 local package_root = root ".tests/site/pack/deps/start/" 9 if not vim.loop.fs_stat(package_root .. name) then 10 print("Installing " .. plugin) 11 vim.fn.mkdir(package_root, "p") 12 vim.fn.system { 13 "git", 14 "clone", 15 "--depth=1", 16 "https://github.com/" .. plugin .. ".git", 17 package_root .. "/" .. name, 18 } 19 end 20end 21 22vim.cmd [[set runtimepath=$VIMRUNTIME]] 23vim.opt.runtimepath:append(root()) 24vim.opt.packpath = { root ".tests/site" } 25vim.notify = print 26 27install_plug "nvim-lua/plenary.nvim" 28install_plug "nvim-treesitter/nvim-treesitter" 29install_plug "echasnovski/mini.doc" -- used for docs generation 30 31vim.env.XDG_CONFIG_HOME = root ".tests/config" 32vim.env.XDG_DATA_HOME = root ".tests/data" 33vim.env.XDG_STATE_HOME = root ".tests/state" 34vim.env.XDG_CACHE_HOME = root ".tests/cache"