Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Jan 28, 2024
1 parent ff71588 commit edbd263
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion doc/cmp-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Requirements
==============================================================================
Setting *cmp-dictionary-setting*

Each time setup() is called, it merges with the previous setup. That is, if
only some options are specified, the values of other options specified in
previous setups remain the same.

Example setting.
>lua
require("cmp").setup({
Expand All @@ -41,15 +45,33 @@ Example setting.
}
})

local dict = {
["*"] = { "/usr/share/dict/words" },
ft = {
foo = { "/path/to/foo.dict" },
},
}

require("cmp_dictionary").setup({
paths = { "/usr/share/dict/words" },
paths = dict["*"],
exact_length = 2,
first_case_insensitive = true,
document = {
enable = true,
command = { "wn", "${label}", "-over" },
},
})

vim.api.nvim_create_autocmd("FileType", {
pattern = "*",
callback = function(ev)
local paths = dict.ft[ev.match] or {}
vim.list_extend(paths, dict["*"])
require("cmp_dictionary").setup({
paths = paths,
})
end
})
<


Expand Down

0 comments on commit edbd263

Please sign in to comment.