Try to use luasnip with cmp

This commit is contained in:
Oliver Hartmann 2021-09-09 21:32:53 +02:00
parent f71bb836a2
commit 9009d1365f
2 changed files with 8 additions and 3 deletions

View File

@ -66,9 +66,13 @@ cmp.setup {
end
end, {"i", "s"})
},
snippet = {expand = function(args) vim.fn["UltiSnips#Anon"](args.body) end},
snippet = {
expand = function(args)
require'luasnip'.lsp_expand(args.body)
end
},
sources = {
{name = 'nvim_lsp'}, {name = 'buffer'}, {name = "ultisnips"},
{name = 'nvim_lsp'}, {name = 'buffer'}, {name = "luasnip"},
{name = "nvim_lua"}, {name = "look"}, {name = "path"},
{name = 'cmp_tabnine'}, {name = "calc"}, {name = "spell"},
{name = "emoji"}

View File

@ -22,11 +22,12 @@ return require('packer').startup(function()
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp',
'quangnguyen30192/cmp-nvim-ultisnips', 'hrsh7th/cmp-nvim-lua',
'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-nvim-lua',
'octaltree/cmp-look', 'hrsh7th/cmp-path', 'hrsh7th/cmp-calc',
'f3fora/cmp-spell', 'hrsh7th/cmp-emoji'
}
}
use {'rafamadriz/friendly-snippets'}
use {'onsails/lspkind-nvim'}
use {'Shatur/neovim-cmake',
requires = {'mfussenegger/nvim-dap', 'skywind3000/asyncrun.vim'}