Add cspell to null-ls again

Use limited filetypes to not make it annoying this time
This commit is contained in:
Evie Litherland-Smith 2023-06-12 12:06:45 +01:00
parent 07c9a227d7
commit 99ce5c68d8

View file

@ -65,8 +65,14 @@ local config = function()
end end
local builtins = require "null-ls.builtins" 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 { require("null-ls").setup {
sources = { 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.code_actions.gitsigns,
builtins.formatting.alejandra, builtins.formatting.alejandra,
builtins.formatting.beautysh, builtins.formatting.beautysh,
@ -88,6 +94,11 @@ return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
cond = not vim.g.vscode, cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" }, 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, config = config,
} }