diff options
author | Guangxiong Lin <[email protected]> | 2021-11-20 14:10:51 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2021-11-20 14:10:51 +0800 |
commit | ae919e3475e39a5c19ea43fc470b32ad3c4f3a49 (patch) | |
tree | 6ea7e27f289c91376ce0765ff92ef6df8f128403 | |
parent | 900a3a47bbadf74e10231851e8d9f854759f93cd (diff) | |
download | dotfiles-ae919e3475e39a5c19ea43fc470b32ad3c4f3a49.tar.gz dotfiles-ae919e3475e39a5c19ea43fc470b32ad3c4f3a49.tar.bz2 dotfiles-ae919e3475e39a5c19ea43fc470b32ad3c4f3a49.zip |
Add ycm install script
-rw-r--r-- | .vim/plugin/init.vim | 12 |
1 files changed, 11 insertions, 1 deletions
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' |