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.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 's' }), [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }) }, sources = { { name = 'nvim_lsp' }, -- For vsnip user. { name = 'vsnip' }, -- For luasnip user. -- { name = 'luasnip' }, -- For ultisnips user. -- { name = 'ultisnips' }, { name = 'buffer' }, } }) EOF