From d30f423af189af0246e7ed9bbf2b3e992acf3455 Mon Sep 17 00:00:00 2001 From: Timothy Mertz Date: Thu, 3 Aug 2023 13:46:00 -0500 Subject: [PATCH] feat(neoconf): Move to separate plugin spec Moves neoconf to its own plugin spec so that neoconf can be used in an environment where LSP is not necessary. --- lua/lazyvim/plugins/editor.lua | 12 ++++++++++++ lua/lazyvim/plugins/lsp/init.lua | 6 +----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index d073dc58..59c4f0a2 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -461,4 +461,16 @@ If you rather use leap/flit instead, you can add the leap extra: { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, }, + + -- Manages global and project-local settings. + { + "folke/neoconf.nvim", + cmd = "Neoconf", + config = function() + if Util.has("neoconf.nvim") then + local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] + require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) + end + end, + }, } diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 9c542b35..4870183d 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -4,7 +4,7 @@ return { "neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile" }, dependencies = { - { "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, + { "folke/neoconf.nvim" }, { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", @@ -90,10 +90,6 @@ return { config = function(_, opts) local Util = require("lazyvim.util") - if Util.has("neoconf.nvim") then - local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] - require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) - end -- setup autoformat require("lazyvim.plugins.lsp.format").setup(opts) -- setup formatting and keymaps