This is a telescope.nvim extension that lists all spelling mistakes in the current buffer using Neovim's built-in spell-checking capabilities.
require("lazy").setup({
{
"matkrin/telescope-spell-errors.nvim",
config = function()
require("telescope").load_extension("spell_errors")
end,
dependencies = "nvim-telescope/telescope.nvim",
}
})
use "matkrin/telescope-spell-errors.nvim"
Plug "matkrin/telescope-spell-errors.nvim",
After calling require("telescope").setup()
:
require("telescope").load_extension("spell_errors")
Similar to lsp_diagnostics
, the results show the type of the spelling mistake
(bad | rare | local | caps), its location (row:col) and the word itself. By
default these get highlighted according to the your color scheme's highlight
color (guisp of SpellBad
, SpellCap
, SpellRare
, SpellLocal
) You can
overwrite these with the following highlight groups:
Error type | Highlight group |
---|---|
bad | "TelescopeSpellErrorBad" |
rare | "TelescopeSpellErrorRare" |
local | "TelescopeSpellErrorLocal" |
caps | "TelescopeSpellErrorCap" |
Important
The highlight groups must be set after loading the extension
Once installed and spell checking is on, you can invoke the picker with the vim command:
:Telescope spell_errors
Or in Lua with:
require("telescope").extensions.spell_errors.spell_errors()
This will open a Telescope window showing all spelling errors in the current buffer. Selecting an entry will move the cursor to the corresponding misspelled word.