Skip to content

Commit

Permalink
docs(README): add setup instructions for integrating cspell with lazyvim
Browse files Browse the repository at this point in the history
  • Loading branch information
daehyunpy authored and davidmh committed Feb 2, 2025
1 parent be04e47 commit fb104ec
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
A companion plugin for [nvimtools/none-ls.nvim](https://github.com/nvimtools/none-ls.nvim),
adding support for [cspell] diagnostics and code actions.

## How to setup in lazyvim

Make sure you have `cpsell` installed, and then add the following
to your plugin configuration directory.

```lua
return {
{
"nvimtools/none-ls.nvim",
event = "VeryLazy",
depends = { "davidmh/cspell.nvim" },
opts = function(_, opts)
local cspell = require("cspell")
opts.sources = opts.sources or {}
table.insert(
opts.sources,
cspell.diagnostics.with({
diagnostics_postprocess = function(diagnostic)
diagnostic.severity = vim.diagnostic.severity.HINT
end,
})
)
table.insert(opts.sources, cspell.code_actions)
end,
},
}
```

## Diagnostics

```lua
Expand All @@ -21,7 +49,6 @@ require("null-ls").setup {
- Command: `cspell`
- Args: dynamically resolved (see [diagnostics source])


## Code Actions

```lua
Expand Down Expand Up @@ -178,7 +205,9 @@ All tests expect the latest Neovim master.
- [ ] Custom configuration examples

# Credits

<!-- cSpell:disable -->

These sources were initially written in jose-elias-alvarez/null-ls.nvim, with
contributions from: [@JA-Bar], [@PumpedSardines], [@Saecki], [@Sloff], [@marianozunino],
[@mtoohey31] and [@yoo].
Expand Down

0 comments on commit fb104ec

Please sign in to comment.