@@ -94,45 +94,45 @@ body:
9494 -- #######################################
9595
9696 local root = vim.fn.stdpath("run") .. "/nvim/diffview.nvim"
97- vim.fn.mkdir(root, "p")
97+ local plugin_dir = root .. "/plugins"
98+ vim.fn.mkdir(plugin_dir, "p")
9899
99- -- set stdpaths to use root
100100 for _, name in ipairs({ "config", "data", "state", "cache" }) do
101101 vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
102102 end
103103
104- -- bootstrap lazy
105- local lazypath = root .. "/plugins/lazy.nvim"
106- if not vim.loop.fs_stat(lazypath) then
107- vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
108- end
109- vim.opt.runtimepath:prepend(lazypath)
110-
111- -- install plugins
112104 local plugins = {
113- {
114- "sindrets/diffview.nvim",
115- dependencies = { "nvim-tree/nvim-web-devicons" },
116- config = function()
117- require("diffview").setup({
118- -- ##############################################################################
119- -- ### ADD DIFFVIEW.NVIM CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE ###
120- -- ##############################################################################
121- })
122- end,
123- },
105+ { "nvim-web-devicons", url = "https://github.com/nvim-tree/nvim-web-devicons.git" },
106+ { "diffview.nvim", url = "https://github.com/sindrets/diffview.nvim.git" },
124107 -- ##################################################################
125108 -- ### ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
126109 -- ##################################################################
127110 }
128- require("lazy").setup(plugins, { root = root .. "/plugins" })
129- require("lazy").sync({ show = false, wait = true })
111+
112+ for _, spec in ipairs(plugins) do
113+ local install_path = plugin_dir .. "/" .. spec[1]
114+ if vim.fn.isdirectory(install_path) ~= 1 then
115+ if spec.url then
116+ print(string.format("Installing '%s'...", spec[1]))
117+ vim.fn.system({ "git", "clone", "--depth=1", spec.url, install_path })
118+ end
119+ end
120+ vim.opt.runtimepath:append(spec.path or install_path)
121+ end
122+
123+ require("diffview").setup({
124+ -- ##############################################################################
125+ -- ### ADD DIFFVIEW.NVIM CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE ###
126+ -- ##############################################################################
127+ })
130128
131129 vim.opt.termguicolors = true
132130 vim.cmd("colorscheme " .. (vim.fn.has("nvim-0.8") == 1 and "habamax" or "slate"))
133131
134132 -- ############################################################################
135133 -- ### ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE ###
136134 -- ############################################################################
135+
136+ print("Ready!")
137137 validations :
138138 required : false
0 commit comments