From d27029d1b153d25f91671d7290646d1ae25ee63b Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 19 Nov 2022 11:45:33 +0530 Subject: [PATCH] load base46_cache in instead of minified modules --- init.lua | 2 +- lua/core/options.lua | 1 + lua/plugins/configs/cmp.lua | 2 +- lua/plugins/configs/lspconfig.lua | 2 +- lua/plugins/configs/mason.lua | 2 +- lua/plugins/configs/nvimtree.lua | 2 +- lua/plugins/configs/others.lua | 6 +++--- lua/plugins/configs/telescope.lua | 2 +- lua/plugins/configs/treesitter.lua | 2 +- lua/plugins/configs/whichkey.lua | 2 +- lua/plugins/init.lua | 2 +- 11 files changed, 13 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index 822e157..cc36d01 100644 --- a/init.lua +++ b/init.lua @@ -14,7 +14,7 @@ if fn.empty(fn.glob(install_path)) > 0 then print "Cloning packer .." fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path } - os.execute("mkdir -p " .. vim.fn.stdpath "data" .. "/site/pack/base46_cache/start/compiled_themes/lua/base46_cache/") + os.execute("mkdir -p " .. vim.g.base46_cache) -- install plugins + compile their configs vim.cmd "packadd packer.nvim" diff --git a/lua/core/options.lua b/lua/core/options.lua index 4268684..1731054 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -3,6 +3,7 @@ local g = vim.g local config = require("core.utils").load_config() g.nvchad_theme = config.ui.theme +g.base46_cache = vim.fn.stdpath "cache" .. "/nvchad/base46/" g.toggle_theme_icon = "  " g.transparency = config.ui.transparency diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index f9b2633..c89daae 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.cmp" +loadfile(vim.g.base46_cache .. "cmp")() vim.o.completeopt = "menu,menuone,noselect" diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index 864dd38..6496e94 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.lsp" +loadfile(vim.g.base46_cache .. "lsp")() require "nvchad_ui.lsp" local M = {} diff --git a/lua/plugins/configs/mason.lua b/lua/plugins/configs/mason.lua index 3cb85df..56e378b 100644 --- a/lua/plugins/configs/mason.lua +++ b/lua/plugins/configs/mason.lua @@ -8,7 +8,7 @@ vim.api.nvim_create_augroup("_mason", { clear = true }) vim.api.nvim_create_autocmd("Filetype", { pattern = "mason", callback = function() - require "base46_cache.mason" + loadfile(vim.g.base46_cache .. "mason")() end, group = "_mason", }) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index 4c3910a..abe0863 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.nvimtree" +loadfile(vim.g.base46_cache .. "nvimtree")() local options = { filters = { diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index ac94fba..82dc9cf 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -30,7 +30,7 @@ M.blankline = function() return end - require "base46_cache.blankline" + loadfile(vim.g.base46_cache .. "blankline")() local options = { indentLine_enabled = 1, @@ -135,7 +135,7 @@ M.gitsigns = function() return end - require "base46_cache.git" + loadfile(vim.g.base46_cache .. "git")() local options = { signs = { @@ -159,7 +159,7 @@ M.devicons = function() local present, devicons = pcall(require, "nvim-web-devicons") if present then - require "base46_cache.devicons" + loadfile(vim.g.base46_cache .. "devicons")() local options = { override = require("nvchad_ui.icons").devicons } options = require("core.utils").load_override(options, "kyazdani42/nvim-web-devicons") diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua index 8879b36..fbb46c8 100644 --- a/lua/plugins/configs/telescope.lua +++ b/lua/plugins/configs/telescope.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.telescope" +loadfile(vim.g.base46_cache .. "telescope")() local options = { defaults = { diff --git a/lua/plugins/configs/treesitter.lua b/lua/plugins/configs/treesitter.lua index 5ae94c8..0012a0b 100644 --- a/lua/plugins/configs/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.treesitter" +loadfile(vim.g.base46_cache .. "treesitter")() local options = { ensure_installed = { diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua index a24b2ed..1e561ed 100644 --- a/lua/plugins/configs/whichkey.lua +++ b/lua/plugins/configs/whichkey.lua @@ -4,7 +4,7 @@ if not present then return end -require "base46_cache.whichkey" +loadfile(vim.g.base46_cache .. "whichkey")() local options = { diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index e9cff65..62c91cb 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -29,7 +29,7 @@ local plugins = { ["NvChad/base46"] = { branch = "dev", config = function() - pcall(require, "base46_cache.defaults") + loadfile(vim.g.base46_cache .. "defaults")() end, },