cmp_luasnip icon indicating copy to clipboard operation
cmp_luasnip copied to clipboard

Snippets not showing in completion

Open vanguard-bit opened this issue 1 year ago • 0 comments

Just like this issue #14 i have the same problem....but unlike the issue, i use Snipmate snippets

:Cmpstatus says: unknown source names

  • luasnip

my config looks like this:

return{
  event = "InsertEnter",
  "hrsh7th/nvim-cmp",
  dependencies = {
    'chrisgrieser/cmp_yanky',
    {'L3MON4D3/LuaSnip', build = 'make install_jsregexp'},
    'honza/vim-snippets',
    'saadparwaiz1/cmp_luasnip',
    "hrsh7th/cmp-buffer",
    'neovim/nvim-lspconfig',
    "hrsh7th/cmp-path",
    'hrsh7th/cmp-nvim-lsp',
    'hrsh7th/cmp-cmdline',


  config = function()
  require("luasnip.loaders.from_snipmate").lazy_load()
    local kind_icons = {
   .....
    }

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
local cmp = require'cmp'

cmp.setup({

  formatting = {
   format = function(entry, vim_item)
      vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
      return vim_item
    end
  },

  snippet = {
    expand = function(args).
       require('luasnip').lsp_expand(args.body)
    end,
  },

  window = {
    completion = cmp.config.window.bordered()
          }
  sources = cmp.config.sources({
    { name = 'nvim_lsp' },
    { name = 'luasnip', option = { use_show_condition = false } }, 
    { name = 'buffer', keyword_length = 3},
    {name="cmdline"},
    {name="path"},
    {name="buffer"},
    {name = "crates"}
  })
})

cmp.setup.filetype('gitcommit', {
  sources = cmp.config.sources({
    { name = 'git' }, 
  }, {
    { name = 'buffer' },
  })
})

vanguard-bit avatar Sep 08 '24 15:09 vanguard-bit