Split LSP package definitions to avoid monolithic dependencies list, and add more flexibility

This commit is contained in:
Evie Litherland-Smith 2023-02-21 07:07:42 +00:00
parent 396e683145
commit 7999de3fca

View file

@ -1,31 +1,39 @@
return { return {
"neovim/nvim-lspconfig", {
event = { "BufReadPre", "BufNewFile" }, "neovim/nvim-lspconfig",
dependencies = { event = { "BufReadPre", "BufNewFile" },
{ "hrsh7th/nvim-cmp" }, dependencies = {
{ "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-buffer" }, { "rafamadriz/friendly-snippets" },
{ "hrsh7th/cmp-path" }, { "windwp/nvim-autopairs" },
{ "hrsh7th/cmp-cmdline" }, },
{ "f3fora/cmp-spell" }, config = function()
{ "petertriho/cmp-git" }, local config = require "lsp.config"
{ "Dosx001/cmp-commit" }, require("null-ls").setup {
{ "kdheepak/cmp-latex-symbols" }, sources = require "lsp.null_ls_sources",
{ "L3MON4D3/LuaSnip" }, on_attach = config.on_attach,
{ "saadparwaiz1/cmp_luasnip" }, flags = config.lsp_flags,
{ "rafamadriz/friendly-snippets" }, capabilities = config.capabilities,
{ "windwp/nvim-autopairs" }, }
{ "jose-elias-alvarez/null-ls.nvim" }, require "lsp.cmp"
{ "folke/neodev.nvim" }, end,
}, },
config = function() {
local config = require "lsp.config" "hrsh7th/nvim-cmp",
require("null-ls").setup { dependencies = {
sources = require "lsp.null_ls_sources", { "hrsh7th/cmp-nvim-lsp" },
on_attach = config.on_attach, { "hrsh7th/cmp-buffer" },
flags = config.lsp_flags, { "hrsh7th/cmp-path" },
capabilities = config.capabilities, { "hrsh7th/cmp-cmdline" },
} { "f3fora/cmp-spell" },
require "lsp.cmp" { "petertriho/cmp-git" },
end, { "Dosx001/cmp-commit" },
{ "kdheepak/cmp-latex-symbols" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
},
cmd = "CmpStatus",
},
{ "jose-elias-alvarez/null-ls.nvim", dependencies = { "neovim/nvim-lspconfig" }, lazy = true },
{ "folke/neodev.nvim", dependencies = { "neovim/nvim-lspconfig", "hrsh7th/nvim-cmp" }, lazy = true },
} }