From: Samir Benmendil Date: Tue, 11 Apr 2023 15:46:02 +0000 (+0100) Subject: vim: do not Plug UltiSnips in nvim X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ba31513cbbc303d0188078cc81b6e7b3b1ce0238 vim: do not Plug UltiSnips in nvim There's LuaSnips. --- diff --git a/vim/vimrc b/vim/vimrc index d94c7c2..9fd4ae5 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -116,9 +116,42 @@ endif "}}} -" snippets -Plug 'sirver/ultisnips' -Plug 'honza/vim-snippets' +if !has("nvim") + Plug 'sirver/ultisnips' " {{{ + Plug 'honza/vim-snippets' + + let g:UltiSnipsEditSplit = 'vertical' + let g:UltiSnipsSnippetDirectories = [ expand("$XDG_CONFIG_HOME/vim/ultisnips") ] + if has('fname_case') + let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] + endif + let g:UltiSnipsExpandTrigger = "" + let g:UltiSnipsJumpForwardTrigger = "" + let g:UltiSnipsJumpBackwardTrigger = "" + + " UltiSnips completion function that tries to expand a snippet. If there's no + " snippet for expanding, it checks for completion window and if it's shown, + " selects first element. If there's no completion window it tries to jump to + " next placeholder. If there's no placeholder it just returns TAB key + " https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411 + 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 + au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" + let g:UltiSnipsListSnippets="" +"}}} +endif " text objects Plug 'kana/vim-textobj-user' @@ -769,38 +802,6 @@ let g:tcomment_textobject_inlinecomment = 'gic' let g:tcomment#filetype#guess = 0 "let g:tcomment#options = {'whitespace' : 'no'} -" ultisnips {{{2 -let g:UltiSnipsEditSplit = 'vertical' -let g:UltiSnipsSnippetDirectories = [ expand("$XDG_CONFIG_HOME/vim/ultisnips") ] -if has('fname_case') - let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] -endif -let g:UltiSnipsExpandTrigger = "" -let g:UltiSnipsJumpForwardTrigger = "" -let g:UltiSnipsJumpBackwardTrigger = "" - -" UltiSnips completion function that tries to expand a snippet. If there's no -" snippet for expanding, it checks for completion window and if it's shown, -" selects first element. If there's no completion window it tries to jump to -" next placeholder. If there's no placeholder it just returns TAB key -" https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411 -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 -au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" -let g:UltiSnipsListSnippets="" - " unite {{{2 call unite#filters#matcher_default#use(['matcher_fuzzy']) call unite#custom#profile('default', 'context', {