Vim Ultisnips - How do I move to the next placeholder or tabstop?

徘徊边缘 提交于 2020-06-24 06:03:43

问题


I just installed a brand new copy of Macvim and UltiSnips, but I can't figure out how to move to the next completions using tabstops and placeholders.

When I press tab, it simply adds a tab space.

My guess is that the tab key was remapped in another plugin or vimrc, so I went with fresh installs and an empty ~/.vim folder. Still nothing...

How do I move to the next tabstop? Is there a key mapping I can set?


回答1:


I have the following in my vimrc:

" Set ultisnips triggers
let g:UltiSnipsExpandTrigger="<tab>"                                            
let g:UltiSnipsJumpForwardTrigger="<tab>"                                       
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"                                    



回答2:


It looks like jumping to the next tabstop was mapped to control j. I switched it to tab in the ultisnips source.

" The trigger used to jump forward to the next placeholder.
" NOTE: expansion and forward jumping can, but needn't be the same trigger

if !exists("g:UltiSnipsJumpForwardTrigger")
    let g:UltiSnipsJumpForwardTrigger = "<tab>"
endif


来源:https://stackoverflow.com/questions/19039443/vim-ultisnips-how-do-i-move-to-the-next-placeholder-or-tabstop

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