8000 GitHub - yutkat/cmp-dictionary: A dictionary completion source for nvim-cmp
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A dictionary completion source for nvim-cmp

License

Notifications You must be signed in to change notification settings

yutkat/cmp-dictionary

 
 

Repository files navigation

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

About

A dictionary completion source for nvim-cmp

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages

  • Lua 99.9%
  • Makefile 0.1%
0