diff --git a/nvim/nvim-cmp.vimrc b/nvim/nvim-cmp.vimrc index b1852f4..41d60ce 100644 --- a/nvim/nvim-cmp.vimrc +++ b/nvim/nvim-cmp.vimrc @@ -1,5 +1,26 @@ 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 <