1

I am using the setup I found in this answer: https://stackoverflow.com/a/22253548/2241241

namely

" if you use Vundle, load plugins:
Bundle 'ervandew/supertab'
Bundle 'Valloric/YouCompleteMe'
Bundle 'SirVer/ultisnips'

" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'

" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"

I am working on a tex document, and trying to insert the snippet in the screenshot. Pressing tab, or ctrl-n will cycle me through the options presented, but I can't for the life of me insert the snippet. Pressing enter, space of just continuing with { just behaves as if I were typing (which I guess is what is to be expected, but I had no better idea).

What do I need to do to insert the snippet shown there?

enter image description here

  • What about changing forward trigger and backward trigger to <c-j> and <c-k>? I am using deoplete and have no problem in inserting snippets. – jdhao Jan 9 at 15:28
  • Use other expansion trigger – eyal karni Jan 9 at 16:09
  • Does <C-Y> work if you have the snippet highlighted? – filbranden Jan 9 at 17:36
  • @jdhao changing the above to let g:UltiSnipsJumpForwardTrigger = "<c-j>" doesn't do anything, I press ctrl-j and nothing happens. – fbence Jan 9 at 19:48
  • @filbranden Unfortunately, no. – fbence Jan 9 at 19:49
0

Code:

let g:UltiSnipsExpandTrigger = '<c-g>'
    "strange that I have to change this
    let g:SuperTabMappingForward = '<s-tab>'
    let g:SuperTabMappingBackward = '<tab>'

go to the snip option in the menu, and press ctrl-g.

Originally, it supposed to be tab, what expands. But supertab has taken control over tab.

| improve this answer | |
  • This doesn't work either. I think I will need to disable all other plugins and figure out what is going on ... – fbence Jan 10 at 9:58
  • You can check my vimrc. I have a similar configuration github.com/eyalk5/.vim – eyal karni Jan 10 at 11:35
  • I copied the relevant part – eyal karni Jan 10 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.