UltiSnips and YouCompleteMe

前端 未结 14 1901
囚心锁ツ
囚心锁ツ 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: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 "\"
        else
          call UltiSnips#JumpForwards()
          if g:ulti_jump_forwards_res == 0
            return "\"
          endif
        endif
      endif
      return ""
    endfunction
    
    function! g:UltiSnips_Reverse()
      call UltiSnips#JumpBackwards()
      if g:ulti_jump_backwards_res == 0
        return "\"
      endif
    
      return ""
    endfunction
    
    
    if !exists("g:UltiSnipsJumpForwardTrigger")
      let g:UltiSnipsJumpForwardTrigger = ""
    endif
    
    if !exists("g:UltiSnipsJumpBackwardTrigger")
      let g:UltiSnipsJumpBackwardTrigger=""
    endif
    
    au InsertEnter * exec "inoremap  " . g:UltiSnipsExpandTrigger     . " =g:UltiSnips_Complete()"
    au InsertEnter * exec "inoremap  " .     g:UltiSnipsJumpBackwardTrigger . " =g:UltiSnips_Reverse()"
    

提交回复
热议问题