From a4ce31d3ecd6285878a9d226ef81c1c0db2ce39a Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Wed, 8 Feb 2017 17:14:01 +0100 Subject: Added conditional YCM options --- vim/.vim/vimrc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'vim/.vim/vimrc') diff --git a/vim/.vim/vimrc b/vim/.vim/vimrc index b5d7309..a353d2c 100755 --- a/vim/.vim/vimrc +++ b/vim/.vim/vimrc @@ -14,7 +14,17 @@ Plug 'unblevable/quick-scope' Plug 'vim-airline/vim-airline-themes' if has('python') || has('python3') - Plug 'Valloric/YouCompleteMe', {'do': './install.py --clang-completer'} + let g:ycm_install_command = './install.py --clang-completer' + + if executable('node') && executable('npm') + let g:ycm_install_command .= ' --tern-completer' + endif + + if executable('go') + let g:ycm_install_command .= ' --gocode-completer' + endif + + Plug 'Valloric/YouCompleteMe', {'do': g:ycm_install_command} endif call plug#end() @@ -134,6 +144,11 @@ if exists("g:plug_home") let g:airline_symbols.space = "\ua0" set laststatus=2 + + if exists('g:ycm_install_command') + let g:ycm_autoclose_preview_window_after_completion = 1 + let g:ycm_autoclose_preview_window_after_insertion = 1 + endif endif " vim: set ts=8 sw=4 tw=0 et : -- cgit v1.2.3