local cmp = require('cmp') cmp.setup({ sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, }, mapping = { [''] = cmp.mapping.confirm({ select = false }), [''] = cmp.mapping.abort(), [''] = cmp.mapping.select_prev_item({ behavior = 'select' }), [''] = cmp.mapping.select_next_item({ behavior = 'select' }), [''] = cmp.mapping.select_next_item({ behavior = 'select' }), [''] = cmp.mapping(function() if cmp.visible() then cmp.select_prev_item({ behavior = 'insert' }) else cmp.complete() end end), [''] = cmp.mapping(function() if cmp.visible() then cmp.select_next_item({ behavior = 'insert' }) else cmp.complete() end end), }, snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end, }, })