uga-rosa / cmp-dictionary

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

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,
    },
  }
})

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

See help for details.