From 7cd80a35c6240a4098cac3ed2580f9386168b193 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 8 Jan 2023 07:40:00 +0530 Subject: [PATCH] include downloading of lazy-lock.json while bootstrapping also pin all plugins by default --- lua/core/bootstrap.lua | 8 ++++++++ lua/core/default_config.lua | 2 +- lua/plugins/init.lua | 11 ++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 83bbec3..f4a026e 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -1,6 +1,14 @@ local M = {} M.lazy = function(install_path) + print "Downloading lazy-lock.json file..." + + local config_branch = require("core.utils").load_config().options.nvChad.update_branch + + vim.cmd( + "!curl -o lazy-lock.json https://raw.githubusercontent.com/NvChad/extensions/lazy-lock/" .. config_branch .. ".json " + ) + print "Bootstrapping lazy.nvim .." vim.fn.system { diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 435ee0a..bd9e037 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -5,7 +5,7 @@ local M = {} M.options = { nvChad = { update_url = "https://github.com/NvChad/NvChad", - update_branch = "lazy", + update_branch = "v2.0", }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 5458354..c2f4525 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -4,14 +4,14 @@ local plugins = { ["nvim-lua/plenary.nvim"] = {}, - ["NvChad/extensions"] = { branch = "lazy" }, + ["NvChad/extensions"] = { branch = "v2.0" }, ["NvChad/base46"] = { - branch = "lazy", + branch = "v2.0", }, ["NvChad/ui"] = { - branch = "lazy", + branch = "v2.0", lazy = false, config = function() require "nvchad_ui" @@ -183,6 +183,11 @@ local plugins = { }, } +-- pin commits for all default plugins +for _, value in pairs(plugins) do + value.pin = true +end + plugins = require("core.utils").merge_plugins(plugins) -- load lazy.nvim options