set completeopt=menu,menuone,noselect " Expand imap vsnip#expandable() ? '(vsnip-expand)' : '' smap vsnip#expandable() ? '(vsnip-expand)' : '' " Expand or jump imap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' smap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' " Jump forward or backward imap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' smap vsnip#jumpable(1) ? '(vsnip-jump-next)' : '' imap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' smap vsnip#jumpable(-1) ? '(vsnip-jump-prev)' : '' " Select or cut text to use as $TM_SELECTED_TEXT in the next snippet. " See https://github.com/hrsh7th/vim-vsnip/pull/50 nmap s (vsnip-select-text) xmap s (vsnip-select-text) nmap S (vsnip-cut-text) xmap S (vsnip-cut-text) lua <'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }), [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), [''] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. [''] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close(), }), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }) }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, -- For vsnip users. -- { name = 'luasnip' }, -- For luasnip users. -- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'snippy' }, -- For snippy users. }, { { name = 'buffer' }, }) }) -- Set configuration for specific filetype. cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. }, { { name = 'buffer' }, }) }) -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline('/', { sources = { { name = 'buffer' } } }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) EOF