Post - Luasnip

Iโ€™ve been using neovim and have wanted to get LSP snippets working with nvim-cmp for a while now. I finally figured out how to do it. The crux is you have to โ€œconfirmโ€ the snippet from nvim-cmp. The configuration looks like

local ls = require 'luasnip'
local cmp = require'cmp'
cmp.setup{
  sources = {
        ...
        { name = 'luasnip' },
        ...
  },
  mapping = {
    ...
    ["<C-l>"] = cmp.mapping(
      cmp.mapping.confirm {
        behavior = cmp.ConfirmBehavior.Insert,
        select = true,
      },
      { "i", "c" }
    ),
    ...
  },
  snippet = {
    expand = function(args)
      require'luasnip'.lsp_expand(args.body)
    end,
  },
  ...
}

and thatโ€™s it! Now combined with my snippet config I can type, complete, and enter the snippet.