From a2690a4b728026c1b662367f63013ced30f4b5f9 Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 18 Feb 2023 14:26:40 +0530 Subject: [PATCH] avoid loading cached highlights in plugin opts file --- lua/core/bootstrap.lua | 23 +++++++++++++---------- lua/plugins/configs/mason.lua | 2 -- lua/plugins/configs/nvimtree.lua | 2 -- lua/plugins/configs/telescope.lua | 2 -- lua/plugins/configs/treesitter.lua | 2 -- lua/plugins/configs/whichkey.lua | 2 -- lua/plugins/init.lua | 7 +++++++ 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 84a30a9..bca43c3 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -1,13 +1,6 @@ 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 - local lazy_local_url = "https://raw.githubusercontent.com/NvChad/extensions/lazy-lock/" .. config_branch .. ".json" - - vim.fn.system { "curl", "-o", "lazy-lock.json", lazy_local_url } - print "Bootstrapping lazy.nvim .." vim.fn.system { @@ -30,7 +23,8 @@ M.lazy = function(install_path) -- install binaries from mason.nvim & tsparsers on LazySync vim.schedule(function() - vim.cmd "bw | silent! MasonInstallAll" -- close lazy window + vim.cmd "silent! MasonInstallAll" + -- print success message end, 0) end @@ -41,9 +35,18 @@ M.gen_chadrc_template = function() if input == "y" then -- clone example_config repo - local example_config_url = "https://github.com/NvChad/example_config" print "cloning chadrc starter template repo...." - vim.fn.system { "git", "clone", "--depth", "1", "-b", "v2.0", example_config_url, vim.fn.stdpath "config" .. "/lua/custom" } + + vim.fn.system { + "git", + "clone", + "--depth", + "1", + "-b", + "v2.0", + "https://github.com/NvChad/example_config", + vim.fn.stdpath "config" .. "/lua/custom", + } vim.cmd "redraw|echo ''" -- delete .git from that repo diff --git a/lua/plugins/configs/mason.lua b/lua/plugins/configs/mason.lua index 0777e0c..8ccc313 100644 --- a/lua/plugins/configs/mason.lua +++ b/lua/plugins/configs/mason.lua @@ -1,5 +1,3 @@ -dofile(vim.g.base46_cache .. "mason") - local options = { ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index 1a260c1..0fda31c 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -1,5 +1,3 @@ -dofile(vim.g.base46_cache .. "nvimtree") - local options = { filters = { dotfiles = false, diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua index 16eac04..784fb19 100644 --- a/lua/plugins/configs/telescope.lua +++ b/lua/plugins/configs/telescope.lua @@ -1,5 +1,3 @@ -dofile(vim.g.base46_cache .. "telescope") - local options = { defaults = { vimgrep_arguments = { diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua index edea6ec..b21b55d 100644 --- a/lua/plugins/configs/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -1,5 +1,3 @@ -dofile(vim.g.base46_cache .. "syntax") - local options = { ensure_installed = { "lua" }, diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua index 9ec4a68..cfdf4c0 100644 --- a/lua/plugins/configs/whichkey.lua +++ b/lua/plugins/configs/whichkey.lua @@ -1,5 +1,3 @@ -dofile(vim.g.base46_cache .. "whichkey") - local options = { icons = { diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index fea032e..c6f1c21 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -71,6 +71,7 @@ local default_plugins = { build = ":TSUpdate", opts = require "plugins.configs.treesitter", config = function(_, opts) + dofile(vim.g.base46_cache .. "syntax") require("nvim-treesitter.configs").setup(opts) end, }, @@ -105,8 +106,11 @@ local default_plugins = { { "williamboman/mason.nvim", cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" }, + opts = require "plugins.configs.mason", config = function(_, opts) + dofile(vim.g.base46_cache .. "mason") require("mason").setup(opts) + -- custom nvchad cmd to install all mason binaries listed vim.api.nvim_create_user_command("MasonInstallAll", function() vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " ")) @@ -186,6 +190,7 @@ local default_plugins = { init = require("core.utils").load_mappings "nvimtree", opts = require "plugins.configs.nvimtree", config = function(_, opts) + dofile(vim.g.base46_cache .. "nvimtree") require("nvim-tree").setup(opts) end, }, @@ -200,6 +205,7 @@ local default_plugins = { end, config = function(_, opts) + dofile(vim.g.base46_cache .. "telescope") local telescope = require "telescope" telescope.setup(opts) @@ -218,6 +224,7 @@ local default_plugins = { init = require("core.utils").load_mappings "whichkey", opts = require "plugins.configs.whichkey", config = function(_, opts) + dofile(vim.g.base46_cache .. "whichkey") require("which-key").setup(opts) end, },