mirror of
https://github.com/catppuccin/nvim
synced 2024-09-16 13:24:08 +02:00
chore: move to lazy.nvim in minimal init
This commit is contained in:
parent
42a9d06e87
commit
1b18b5850a
1 changed files with 23 additions and 40 deletions
63
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
63
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue