Closed ghost closed 4 years ago
You need to change the default
text before jumping.
I don't know what UltiSnips is doing under the hood, but apparently Tab is disabled until you change the text, i.e., pressing Tab while on default
does not trigger the plug.
I am able to jump without changing the default
text if I use <C-right>
instead of <tab>
. Only when I try to go the mucomplete
way the tab won't allow me jump.
@lifepillar I looked through ultisnips keymappings and found that when there is a default value for a placeholder, ultisnips changes the mode to SELECT
. To jump to next placeholder then requires mapping <tab>
in SELECT
mode as well. I added the following in my configuration:
snoremap <silent> <tab> <Esc>:call UltiSnips#ExpandSnippetOrJump()<cr>
And now I am able to jump from default value. Might be a good idea to include in the documentation. What say?
Say I have a snippet
After I expand the snippet, I am able to jump from
$1
to$0
using<tab>
. But if I change$1
to${1:default}
to have a default text, the jump no longer works with<tab>
. It still works with ultisnips forward trigger<C-right>
. Here are my relevantmu-complete
andultisnips
settings: