local cmp = require('cmp') cmp.setup { mapping = { [''] = cmp.mapping.complete(), [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true, }, [''] = function(fallback) if cmp.visible() then cmp.select_prev_item() else fallback() end end, [''] = function(fallback) if cmp.visible() then cmp.select_next_item() else fallback() end end, }, sources = { { name = 'neorg' }, { name = 'nvim_lua' }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, { name = 'buffer' }, }, snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end }, }