From 99ce5c68d811a7debe888a84497628dad3cb0c47 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 12 Jun 2023 12:06:45 +0100 Subject: [PATCH] Add cspell to null-ls again Use limited filetypes to not make it annoying this time --- lua/plugins/lspconfig.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 5ef68d3..d402449 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -65,8 +65,14 @@ local config = function() end local builtins = require "null-ls.builtins" + local cspell = require "cspell" + local cspell_filetypes = { "json", "yaml", "html", "markdown", "norg", "gitcommit" } + local cspell_config = { config_file_preferred_name = ".cspell.json" } require("null-ls").setup { sources = { + cspell.diagnostics.with { filetypes = cspell_filetypes, config = cspell_config }, + cspell.code_actions.with { filetypes = cspell_filetypes, config = cspell_config }, + builtins.code_actions.gitsigns, builtins.formatting.alejandra, builtins.formatting.beautysh, @@ -88,6 +94,11 @@ return { "neovim/nvim-lspconfig", cond = not vim.g.vscode, event = { "BufReadPre", "BufNewFile" }, - dependencies = { "cmp-nvim-lsp", "folke/trouble.nvim", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" }, + dependencies = { + "cmp-nvim-lsp", + "folke/trouble.nvim", + "folke/neodev.nvim", + { "jose-elias-alvarez/null-ls.nvim", dependencies = "davidmh/cspell.nvim" }, + }, config = config, }