Fast, offline word source for blink.cmp. Pure Lua, no other dependencies.
- Fast
- Use Double-Array Tire data structure to build the word completion source, with query time < 0.1 ms.
- Use binary file for serialization, only rebuilt when the word source file is updated.
- Async: All operations are performed asynchronously and will never block.
- Limited spell-suggest: Help correct minor spelling mistakes.
- neovim >= v0.11.0
- blink.cmp
Using lazy.nvim
return {
{
"saghen/blink.cmp",
dependencies = {
"xieyonn/blink-cmp-dat-word",
},
opts = {
sources = {
default = {
-- ...
"datword", -- add datword to default sources
},
providers = {
-- add datword provider
datword = {
name = "Word",
module = "blink-cmp-dat-word",
opts = {
paths = {
-- "path_to_your_words.txt", -- add your owned word files before dictionary.
"/usr/share/dict/words", -- This file is included by default on Linux/macOS.
},
},
},
},
},
},
},
}
Query words in order of
opts.paths
, add custom words file before dictionary files.
Options are defined in blink.cmp
, config path: sources.providers.datword.opts
opts = {
paths = { "path_to_your_words" }, -- word source file paths.
build_command = "" -- Define a Command to rebuild words, eg: `BuildDatWord`, then use `BuildDatWord!` to force rebuild cache.
spellsuggest = false,-- Enable limited spellsuggest. eg: enter `thsi` give you `this`.
}
Recommends:
- Google-10000-english 10k most common English words.
/usr/share/dict/words
is a standard system file on Unix-like OSes containing a large list of English words, one word per line.
Or add your own word list, with one word per line.
- blink-cmp-dictionary Use external tools
fzf
orag
to search text files. - blink-cmp-words Use external tool
fzf
to search a formated file, also support thesaurus.
Inspired by cmp-dictionary.