uga-rosa / cmp-dictionary

A dictionary completion source for nvim-cmp
MIT License
236 stars 16 forks source link

My `cmp-dictionary` takes 700+ms on startup as BufEnter #34

Closed Cassin01 closed 1 year ago

Cassin01 commented 1 year ago

Question

Is there any tips for speed up (such as lazy load)?

or

Is this startuptime in the specifications?

Startup time

Before uninstall cmp-dictionary

1299.237  836.919: BufEnter autocommands

After uninstall cmp-dictionary

372.051  005.900: BufEnter autocommands

Version

NVIM v0.8.0-v0.8.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

My Setting

Packer

use {
"uga-rosa/cmp-dictionary"
    ["config"] = function() {
        local path = vim.fn.expand "en.dict"
        local cmp_dict = require("cmp_dictionary")
        cmp_dict.setup({
            ["dict"] = {
                ["*"] = {"/user/share/dict/words"}
                ["spelling"] = {["en"] = path}
            }
    }) 
}
cmp.config.sources {
    ["name"] = "dictionary"
    ["group_incex"] = 5
    ["keyword_length"] 2
}
uga-rosa commented 1 year ago

Have you tried the async option? Also, have you read the chapter in the help section on lazy loading?

Cassin01 commented 1 year ago

I didn't that chapter. Thank you for teaching.