ultisnips icon indicating copy to clipboard operation
ultisnips copied to clipboard

Ultisnips not working with YouCompleteMe Help Needed

Open harsh-singh-rathore opened this issue 3 years ago • 3 comments

Expected behavior: I have YouCompleteMe installed so I used ctrl+p for snippet trigger but maybe instead of ctrl+p becomming the trigger this statement maps tab which also maps youcompleteme trigger. When tab trigger is pressed (in this case ctrl+p )the snippet should complete to whatever the snippet is, for example, cl should expand to a class snippet for python.

Actual behavior: Now when I press c-p it just toggles between some options and when I try to select any of those by pressing the enter key the snippet trigger name is written and the cursor moves to the next line and pressing ctrl+p just toggles between lines produces nothing.

Steps to reproduce

let g:UltiSnipsExpandTrigger="<C-p>"
let g:UltiSnipsJumpForwardTrigger="<C-b>"
let g:UltiSnipsJumpBackwardTrigger="<C-z>"
let g:UltiSnipsEditSplit="vertical"

this is my configuration I used c-p as the trigger because I use YouCompleteMe also and the installation guide said to change the trigger to something else if you used it.

Thanks in advance.

  1. In a .py extension file write cl
  2. clicking tab trigger in this case ctrl+p
  3. toggles between some options and does not produce the reqd output

  • Operating System: Ubuntu 20.04
  • Vim Version: version 8.1.2269
  • UltiSnips Version: Ultisnips 3.2
  • Python inside Vim: 3.8.2 (default, Jul 16 2020, 14:00:26)
  • Docker repo/vimrc:

harsh-singh-rathore avatar Oct 02 '20 15:10 harsh-singh-rathore

Try changing your expand trigger to control-b.

chumbucket avatar Oct 06 '20 18:10 chumbucket

I have the same issue

Try changing your expand trigger to control-b.

@chumbucket This does not work... I have the following in my .vimrc

let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
let g:UltiSnipsEditSplit="vertical"

This actually fails and does not expand when I hit tab.

If I replace <tab> with <return>, then it remaps <return> and i can no longer use it as expected during insert mode; which is when Ultisnips is active and usable.

let g:UltiSnipsExpandTrigger="<return>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
let g:UltiSnipsEditSplit="vertical"

If I use mode inoremap to avoid remapping and to enable it during insert mode, it still fails, and there is no visible change or effect.

let g:UltiSnipsExpandTrigger="inoremap <tab> <return>"
let g:UltiSnipsJumpForwardTrigger="inoremap <tab> <tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
let g:UltiSnipsEditSplit="vertical"

The expected format is

map-command map-argument {LHS} {RHS}

If I simply try to remap the key for insert mode using only {LHS} and ommitting map-argument and {RHS}, I still get the same result.

let g:UltiSnipsExpandTrigger="inoremap <return>"
let g:UltiSnipsJumpForwardTrigger="inoremap <tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
let g:UltiSnipsEditSplit="vertical"

teleprint-me avatar Jan 21 '21 21:01 teleprint-me

I'm using this configuration which seems to be working as a temporary work around. Though, an actual fix, or explanation on how this works, would be much appreciated.

let g:UltiSnipsExpandTrigger="<c-a>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<shift><tab>"
let g:UltiSnipsEditSplit="vertical"

teleprint-me avatar Jan 21 '21 22:01 teleprint-me