diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index c8f8ab5..4051dcc 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -5,6 +5,7 @@ if not present then end local M = {} +local utils = require "core.utils" require("plugins.configs.others").lsp_handlers() @@ -22,8 +23,8 @@ M.on_attach = function(client, bufnr) client.resolved_capabilities.document_formatting = false client.resolved_capabilities.document_range_formatting = false - local lsp_mappings = require("core.utils").load_config().mappings.lspconfig - require("core.utils").load_mappings({ lsp_mappings }, { buffer = bufnr }) + local lsp_mappings = utils.load_config().mappings.lspconfig + utils.load_mappings({ lsp_mappings }, { buffer = bufnr }) end local capabilities = vim.lsp.protocol.make_client_capabilities() @@ -68,7 +69,7 @@ lspconfig.sumneko_lua.setup { } -- requires a file containing user's lspconfigs -local addlsp_confs = require("core.utils").load_config().plugins.options.lspconfig.setup_lspconf +local addlsp_confs = utils.load_config().plugins.options.lspconfig.setup_lspconf if #addlsp_confs ~= 0 then require(addlsp_confs).setup_lsp(M.on_attach, capabilities) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 78bdaaa..2a34557 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,3 +1,5 @@ +local lazy_load = require("core.utils").packer_lazy_load + local plugins = { ["nvim-lua/plenary.nvim"] = {}, @@ -71,7 +73,7 @@ local plugins = { config = function() require("plugins.configs.others").gitsigns() end, - setup = require("core.utils").packer_lazy_load "gitsigns.nvim", + setup = lazy_load "gitsigns.nvim", }, -- lsp stuff @@ -105,7 +107,7 @@ local plugins = { ["andymass/vim-matchup"] = { opt = true, - setup = require("core.utils").packer_lazy_load "vim-matchup", + setup = lazy_load "vim-matchup", }, ["max397574/better-escape.nvim"] = { @@ -198,7 +200,7 @@ local plugins = { ["folke/which-key.nvim"] = { opt = true, - setup = require("core.utils").packer_lazy_load "which-key.nvim", + setup = lazy_load "which-key.nvim", config = function() require "plugins.configs.whichkey" end,