Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

Instead of expansion, <c-k> outputs <Plug>(complete_parameter#goto_previous_parameter) #473

Closed sittim closed 5 years ago

sittim commented 5 years ago

If I type if then use <c-n> to select snippet, then <c-k>, instead of snippet, I get

if<Plug>(complete_parameter#goto_previous_parameter)
call plug#begin('~/.vim/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
let g:deoplete#enable_at_startup = 1
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
call plug#end()

set shell=/bin/sh

" Plugin key-mappings.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
imap <C-k>     <Plug>(neosnippet_expand_or_jump)
smap <C-k>     <Plug>(neosnippet_expand_or_jump)
xmap <C-k>     <Plug>(neosnippet_expand_target)

" SuperTab like snippets behavior.
" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
imap <expr><TAB>
  \ pumvisible() ? "\<C-n>" :
  \ neosnippet#expandable_or_jumpable() ?
  \    "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"

" For conceal markers.
if has('conceal')
  set conceallevel=2 concealcursor=niv
endif
Shougo commented 5 years ago

You <C-k> is overwritten by CompleteParameter plugin's mapping. https://github.com/tenfyzhong/CompleteParameter.vim

You should check it by verboses imap <C-k>.

Note: CompleteParameter.vim is not included in your minimal vimrc. So you don't test the minimal vimrc.

I think you have the mapping like this.

inoremap <C-k>   <Plug>(complete_parameter#goto_previous_parameter)
sittim commented 5 years ago

@Shougo yes what you said is true, the issue was due to mapping. No I know how to check mappings.