ViM provides a list of alternative snippets, but I'm not able to select any of them

╄→尐↘猪︶ㄣ 提交于 2020-01-25 07:41:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!