问题
I can navigate up and down in the list, but if I press Enter when one of them is selected, it just inserts that value, e.g. html5
and exists from the dropdown.
How can I select one and have the snippet triggered?
This is my snippet config:
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
I'm also using Valloric/YouCompleteMe
. No special config for that plugin, though.
回答1:
Try :help ultisnips
g:UltiSnipsExpandTrigger <tab>
g:UltiSnipsListSnippets <c-tab>
g:UltiSnipsJumpForwardTrigger <c-j>
g:UltiSnipsJumpBackwardTrigger <c-k>
In my case I have:
" snippets
let g:UltiSnipsExpandTrigger="<C-j>"
let g:UltiSnipsJumpForwardTrigger="<C-j>"
let g:UltiSnipsJumpBackwardTrigger="<C-k>"
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsListSnippets="<C-Space>"
来源:https://stackoverflow.com/questions/49190190/vim-provides-a-list-of-alternative-snippets-but-im-not-able-to-select-any-of-t