From ae919e3475e39a5c19ea43fc470b32ad3c4f3a49 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sat, 20 Nov 2021 14:10:51 +0800 Subject: Add ycm install script --- .vim/plugin/init.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to '.vim') diff --git a/.vim/plugin/init.vim b/.vim/plugin/init.vim index a6f29cf..b7a06c4 100644 --- a/.vim/plugin/init.vim +++ b/.vim/plugin/init.vim @@ -14,13 +14,23 @@ function! s:load_settings() endfor endfunction +function! BuildYCM(info) + let ycm_install_options=' --clangd-completer' + + if !empty(glob("/usr/bin/go")) || !empty(glob("/usr/local/bin/go")) + let ycm_install_options = ycm_install_options . ' --go-completer' + endif + + exec '!python3 ./install.py' . ycm_install_options +endfunction + let g:ycm_language_server = [] call plug#begin('~/.vim/plugged') " General Plug 'Valloric/YouCompleteMe', { - \ 'do': 'python3 ./install.py --clangd-completer', + \ 'do': function('BuildYCM'), \ } Plug 'prabirshrestha/vim-lsp' -- cgit v1.2.3