1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:20:04 +08:00
SpaceVim/bundle/cmp-dictionary
2023-06-11 21:41:39 +08:00
..
.github/workflows feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
after/plugin feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
doc feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
lua/cmp_dictionary feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
.gitignore feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
.luacheckrc feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
LICENSE feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
Makefile feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
README.md feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00
stylua.toml feat(cmp-dictionary): add cmp-dictionary 2023-06-11 21:41:39 +08:00

cmp-dictionary

A dictionary completion source for nvim-cmp.

This plugin provides one of the easiest way to add desired completion candidates to nvim-cmp.

image

Requirements

Setting

require("cmp").setup({
  -- other settings
  sources = {
  -- other sources
    {
      name = "dictionary",
      keyword_length = 2,
    },
  }
})

local dict = require("cmp_dictionary")

dict.setup({
  -- The following are default values.
  exact = 2,
  first_case_insensitive = false,
  document = false,
  document_command = "wn %s -over",
  async = false,
  sqlite = false,
  max_items = -1,
  capacity = 5,
  debug = false,
})

dict.switcher({
  filetype = {
    lua = "/path/to/lua.dict",
    javascript = { "/path/to/js.dict", "/path/to/js2.dict" },
  },
  filepath = {
    [".*xmake.lua"] = { "/path/to/xmake.dict", "/path/to/lua.dict" },
    ["%.tmux.*%.conf"] = { "/path/to/js.dict", "/path/to/js2.dict" },
  },
  spelllang = {
    en = "/path/to/english.dict",
  },
})

See help for details.

Examples of usage

See wiki