vim.cmd([[set shortmess+=c]]) vim.o.completeopt = "menu,noinsert,noselect,menuone" local cmp = require('cmp') cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end, }, view = { entries = 'native' }, mapping = { [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true, }, [''] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), [''] = cmp.mapping.confirm({ select = true }), }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'nvim_lua' }, { name = 'luasnip' }, }, { { name = 'buffer', keyword_length = 5 }, { name = 'path' }, }), })