Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
Expand Down Expand Up @@ -208,6 +207,10 @@
url = "github:folke/snacks.nvim";
flake = false;
};
"spellwarn.nvim" = {
url = "github:ravibrock/spellwarn.nvim";
flake = false;
};
"which-key.nvim" = {
url = "github:folke/which-key.nvim";
flake = false;
Expand Down
53 changes: 53 additions & 0 deletions lua/plugins/spellwarn.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--[[
-- Spell checker plugin set for English
--
-- Usage:
-- ]s -> jump to next misspelled word
-- [s -> jump to previous misspelled word
-- z= -> show spelling suggestions
-- zg -> add word to dictionary
-- zw -> mark word as wrong
-- ]]

local opts = {
event = { -- event(s) to refresh diagnostics on
-- "CursorHold",
-- "InsertLeave",
"TextChanged",
"TextChangedI",
"TextChangedP",
},
enable = true, -- enable diagnostics on startup
ft_config = { -- spellcheck method: "cursor", "iter", or boolean
alpha = false,
help = false,
lazy = false,
lspinfo = false,
mason = false,
},
ft_default = true, -- default option for unspecified file types
max_file_size = 80, -- maximum file size to check in lines (nil for no limit)
severity = { -- severity for each spelling error type (false to disable diagnostics for that type)
spellbad = "WARN",
spellcap = "HINT",
spelllocal = "HINT",
spellrare = "INFO",
},
suggest = false, -- show spelling suggestions in diagnostic message (works best with window-style message)
num_suggest = 0, -- number of spelling suggestions shown in diagnostic message
prefix = "possible misspelling(s): ", -- prefix for each diagnostic message
diagnostic_opts = { severity_sort = true }, -- options for diagnostic display
}

local function config()
vim.opt.spell = true
vim.opt.spelllang = { "en_us" }

require("spellwarn").setup(opts)
end

return {
"ravibrock/spellwarn.nvim",
lazy = false,
config = config,
}