UltiSnips and YouCompleteMe

来源:互联网 发布:绝地求生透视源码 编辑:程序博客网 时间:2024/06/09 16:14
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 ""endfunctionau BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"let g:UltiSnipsJumpForwardTrigger="<tab>"let g:UltiSnipsListSnippets="<c-e>"" this mapping Enter key to <C-y> to chose the current highlight item " and close the selection list, same as other IDEs." CONFLICT with some plugins like tpope/Endwiseinoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"



代码加入到~/.vimrc中


0 0