UltiSnips and YouCompleteMe

前端 未结 14 1876
囚心锁ツ
囚心锁ツ 2020-12-07 06:40

I have bundles ultisnips and youcompleteme installed on my macvim. The problem is that ultisnips doesn\'t work because tab is bound by ycm. I tried putting let g:UltiS

相关标签:
14条回答
  • 2020-12-07 07:44

    I use ; to expand UltiSnips, it's so nifty for me

    let g:UltiSnipsExpandTrigger = ";"
    
    0 讨论(0)
  • 2020-12-07 07:45

    Just putting together answers by Michaelslec, Joey Liu and along with solutions I found in this issue thread and this guy's vimrc, I now have this which solved pretty much all problems.

    function! g:UltiSnips_Complete()
      call UltiSnips#ExpandSnippet()
      if g:ulti_expand_res == 0
        if pumvisible()
          return "\<C-n>"
        else
          call UltiSnips#JumpForwards()
          if g:ulti_jump_forwards_res == 0
            return "\<TAB>"
          endif
        endif
      endif
      return ""
    endfunction
    
    function! g:UltiSnips_Reverse()
      call UltiSnips#JumpBackwards()
      if g:ulti_jump_backwards_res == 0
        return "\<C-P>"
      endif
    
      return ""
    endfunction
    
    
    if !exists("g:UltiSnipsJumpForwardTrigger")
      let g:UltiSnipsJumpForwardTrigger = "<tab>"
    endif
    
    if !exists("g:UltiSnipsJumpBackwardTrigger")
      let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
    endif
    
    au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger     . " <C-R>=g:UltiSnips_Complete()<cr>"
    au InsertEnter * exec "inoremap <silent> " .     g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"
    
    0 讨论(0)
提交回复
热议问题