chore: move to lazy.nvim in minimal init

This commit is contained in:
nullchilly 2023-03-01 20:21:00 +07:00
parent 42a9d06e87
commit 1b18b5850a

View file

@ -56,52 +56,35 @@ body:
required: true
- type: textarea
attributes:
label: "Minimal config"
description: "Minimal(!) configuration necessary to reproduce the issue. Save this as `minimal.lua`. If _absolutely_ necessary, add plugins and config options from your `init.lua` at the indicated lines."
render: Lua
label: Repro
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
value: |
-- `minimal.lua` used for reproducible configuration
-- Open with `nvim --clean -u minimal.lua`
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
local is_windows = vim.fn.has("win32") == 1
local function join(...)
local sep = is_windows and "\\" or "/"
return table.concat({ ... }, sep)
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
local root_tmp = is_windows and os.getenv("TEMP") or "/tmp"
local site_path = join(root_tmp, "nvim", "site")
local pack_path = join(site_path, "pack")
local install_path = join(pack_path, "packer", "start", "packer.nvim")
local compile_path = join(install_path, "plugin", "packer_compiled.lua")
vim.opt.packpath = site_path
local function load_plugins()
local packer = require("packer")
local use = packer.use
packer.reset()
packer.init({ compile_path = compile_path, package_root = pack_path })
use("wbthomason/packer.nvim")
use({ "catppuccin/nvim", as = "catppuccin" })
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
packer.install()
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
_G.load_config = function()
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
require("catppuccin").setup({
flavour = "mocha"
})
-- install plugins
local plugins = {
"catppuccin/nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.api.nvim_command("colorscheme catppuccin")
end
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]])
vim.cmd.colorscheme("catppuccin")
-- add anything else here
render: Lua
validations:
required: true