ncm2 / ncm2-ultisnips

44 stars 3 forks source link

Function parameter expansion not working? #5

Closed danielsuo closed 6 years ago

danielsuo commented 6 years ago

Hello!

Many thanks for creating this wonderful set of plugins. I'm sure this is user error, but I can't seem to get function parameter expansion to work as you have in the gif in README.md. Below is the relevant section in my init.vim and I was hoping you could help me understand where I've gone wrong!

In other words, not an issue, but a request for help (and possibly a place to add to documentation).

" Completion
  Plug 'ncm2/ncm2'
  Plug 'roxma/nvim-yarp'

  Plug 'ncm2/ncm2-tmux'
  Plug 'ncm2/ncm2-bufword'
  Plug 'ncm2/ncm2-path'
  Plug 'ncm2/ncm2-syntax'
  Plug 'ncm2/ncm2-neoinclude'
  Plug 'ncm2/ncm2-vim'
  Plug 'ncm2/ncm2-go'
  Plug 'ncm2/ncm2-jedi'
  Plug 'ncm2/ncm2-tern'
  Plug 'ncm2/ncm2-pyclang'
  Plug 'ncm2/ncm2-ultisnips'
  Plug 'SirVer/ultisnips'

  " Snippets are separated from the engine. Add this if you want them:
  Plug 'honza/vim-snippets'

  " enable ncm2 for all buffers
  autocmd BufEnter * call ncm2#enable_for_buffer()

  " :help Ncm2PopupOpen for more information
  set completeopt=noinsert,menuone,noselect

  " Press enter key to trigger snippet expansion
  " The parameters are the same as `:help feedkeys()`
  inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')

  " c-j c-k for moving in snippet
  " let g:UltiSnipsExpandTrigger        = "<Plug>(ultisnips_expand)"
  let g:UltiSnipsJumpForwardTrigger = "<c-j>"
  let g:UltiSnipsJumpBackwardTrigger    = "<c-k>"
  let g:UltiSnipsRemoveSelectModeMappings = 0
roxma commented 6 years ago

There're some typo in your vimrc. How do you reproduce the issue with this minimal vimrc?

  Plug 'ncm2/go'
  Plug 'ncm2/jedi'
  Plug 'ncm2/tern'
  Plug 'ncm2/pyclang'
danielsuo commented 6 years ago

Ah shoot, you're right. Silly mistake on my part. Thank you for taking the time to look closely.

Thank you!