This is a nvim-cmp plugin that can help complete words and view translated documents
2023-03-13_22-58-25.mp4
Make sure the system with these procedures
cmake,g++,sqlite3,make,wget,git,unzip
packer.nvim
use {
"denstiny/cmp-dictionary-nanny",
config = function ()
require("cmp-dictionary-nanny.config").setup({opt})
end
run = "./install.sh"
}lazy.nvim
{
"denstiny/cmp-dictionary-nanny",
build = "./install.sh",
event = { "InsertEnter" },
}local conf_defaults = {
max_num_results = 20,
table_name = "stardict",
database_path = vim.fn.stdpath("data") .. "/data/ultimate.db",
item_add_translation = true,
database_url = "https://github.com/skywind3000/ECDICT-ultimate/releases/download/1.0.0/ecdict-ultimate-sqlite.zip",
run_on_every_keystroke = true,
ignored_file_types = { -- default is not to ignore
-- uncomment to ignore in lua:
-- lua = true
},
}you can custom database(default chinese database)
| key | describe |
|---|---|
| word | completion of the word |
| definition | The word meaning |
| translation | word translation |
| frq | Contemporary corpus word frequency |
| bnc | Word processing |
| phonetic | phonetic symbol |
- The database failed download
try perform the plugins directory of the download.sh script