diff --git a/after/plugin/autocompletion.lua b/after/plugin/autocompletion.lua index d29f622..bfcdaad 100644 --- a/after/plugin/autocompletion.lua +++ b/after/plugin/autocompletion.lua @@ -1,9 +1,10 @@ -local cmp = require ('cmp') +local cmp = require('cmp') cmp.setup({ snippet = { expand = function(args) - require('snippy').expand_snippet(args.body) -- For `snippy` users. + print("expand function") + require('luasnip').lsp_expand(args.body) end, }, window = { @@ -19,39 +20,12 @@ cmp.setup({ }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, - { name = 'snippy' }, -- For snippy users. + { name = 'luasnip' }, }, { { name = 'buffer' }, }) }) --- Set configuration for specific filetype. -cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). - }, { - { name = 'buffer' }, - }) -}) - --- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline({ '/', '?' }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = 'buffer' } - } -}) - --- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) -}) - -- Set up lspconfig. local capabilities = require('cmp_nvim_lsp').default_capabilities() require('lspconfig')['gopls'].setup { diff --git a/after/plugin/snippy.lua b/after/plugin/snippy.lua deleted file mode 100644 index 251ed62..0000000 --- a/after/plugin/snippy.lua +++ /dev/null @@ -1,11 +0,0 @@ -require('snippy').setup({ - mappings = { - is = { - [''] = 'expand_or_advance', - [''] = 'previous', - }, - nx = { - ['x'] = 'cut_text', - }, - }, -}) diff --git a/lua/myworkflow/packer.lua b/lua/myworkflow/packer.lua index 73ee4b5..041729b 100644 --- a/lua/myworkflow/packer.lua +++ b/lua/myworkflow/packer.lua @@ -44,8 +44,8 @@ return require('packer').startup(function(use) use 'hrsh7th/nvim-cmp' -- Snippets - use 'dcampos/nvim-snippy' - use 'dcampos/cmp-snippy' + use { "L3MON4D3/LuaSnip" } + use { 'saadparwaiz1/cmp_luasnip' } -- Project explorer use { 'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons' }