Skip to content

Snippy doesn't show snippets (but shows nvim-cmp completions) #120

Closed Answered by nadiamoe
nadiamoe asked this question in Q&A
Discussion options

You must be logged in to vote

I think I've figured this out. I was lacking the following in my nvim-cmp config:

      opts.snippet.expand = function(args)
        require("snippy").expand_snippet(args.body)
      end

      table.insert(opts.sources, { name = "snippy" })

I thought cmp-snippy would take care of that, but it doesn't seem to be the case. After adding those lines, completion boxes show snippets as well:

Full config is now:

return {
  {
    -- Use snippy instead of LuaSnip.
    "L3MON4D3/LuaSnip",
    enabled = false,
  },
  {
    -- cmp-snippy configures nvim-cmp to use nvim-snippy.
    "dcampos/cmp-snippy",
    dependencies = {
      "dcampos/nvim-snippy",
      "hrsh7th/nvim-cmp",
    },
  },
  {
    "d…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nadiamoe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant