From 9009d1365fbc0c913f8ed97843c1595697dd4fce Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Thu, 9 Sep 2021 21:32:53 +0200 Subject: [PATCH] Try to use luasnip with cmp --- lua/cmp_plug.lua | 8 ++++++-- lua/plugins.lua | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/cmp_plug.lua b/lua/cmp_plug.lua index 5fad150..767e9ad 100644 --- a/lua/cmp_plug.lua +++ b/lua/cmp_plug.lua @@ -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"} diff --git a/lua/plugins.lua b/lua/plugins.lua index 4969785..b77226d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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'}