This commit is contained in:
siduck 2022-05-29 16:21:17 +05:30
parent cb97cef2a7
commit 1a1bc99f1b
2 changed files with 9 additions and 6 deletions

View file

@ -5,6 +5,7 @@ if not present then
end end
local M = {} local M = {}
local utils = require "core.utils"
require("plugins.configs.others").lsp_handlers() 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_formatting = false
client.resolved_capabilities.document_range_formatting = false client.resolved_capabilities.document_range_formatting = false
local lsp_mappings = require("core.utils").load_config().mappings.lspconfig local lsp_mappings = utils.load_config().mappings.lspconfig
require("core.utils").load_mappings({ lsp_mappings }, { buffer = bufnr }) utils.load_mappings({ lsp_mappings }, { buffer = bufnr })
end end
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
@ -68,7 +69,7 @@ lspconfig.sumneko_lua.setup {
} }
-- requires a file containing user's lspconfigs -- 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 if #addlsp_confs ~= 0 then
require(addlsp_confs).setup_lsp(M.on_attach, capabilities) require(addlsp_confs).setup_lsp(M.on_attach, capabilities)

View file

@ -1,3 +1,5 @@
local lazy_load = require("core.utils").packer_lazy_load
local plugins = { local plugins = {
["nvim-lua/plenary.nvim"] = {}, ["nvim-lua/plenary.nvim"] = {},
@ -71,7 +73,7 @@ local plugins = {
config = function() config = function()
require("plugins.configs.others").gitsigns() require("plugins.configs.others").gitsigns()
end, end,
setup = require("core.utils").packer_lazy_load "gitsigns.nvim", setup = lazy_load "gitsigns.nvim",
}, },
-- lsp stuff -- lsp stuff
@ -105,7 +107,7 @@ local plugins = {
["andymass/vim-matchup"] = { ["andymass/vim-matchup"] = {
opt = true, opt = true,
setup = require("core.utils").packer_lazy_load "vim-matchup", setup = lazy_load "vim-matchup",
}, },
["max397574/better-escape.nvim"] = { ["max397574/better-escape.nvim"] = {
@ -198,7 +200,7 @@ local plugins = {
["folke/which-key.nvim"] = { ["folke/which-key.nvim"] = {
opt = true, opt = true,
setup = require("core.utils").packer_lazy_load "which-key.nvim", setup = lazy_load "which-key.nvim",
config = function() config = function()
require "plugins.configs.whichkey" require "plugins.configs.whichkey"
end, end,