f3fora / cmp-spell

spell source for nvim-cmp based on vim's spellsuggest.
191 stars 3 forks source link

Help: Load with lazy.nvim #14

Open realhackcraft opened 2 months ago

realhackcraft commented 2 months ago

I use lazy.nvim for all my configs.

Here is my config:

  {
    "hrsh7th/nvim-cmp",
    dependencies = {
      "f3fora/cmp-spell",
    },
    config = function()
      local cmp = require "cmp"

      -- Get the current sources
      local sources = cmp.get_config().sources

      -- Add the new source
      table.insert(sources, {
        name = "spell",
        option = {
          keep_all_entries = false,
          enable_in_context = function()
            return true
          end,
          preselect_correct_word = true,
        },
      })
      -- Setup nvim-cmp with the updated sources
      cmp.setup {
        sources = sources,
      }
    end,
  },

This loads the plugin, but when i ran :CmpStatus, spell is under # unavailable source names and words don't show up when I'm in a md document