Browse Source

Added YouCompleteMe vim plugin with lazyloading hack.

master
Daniel Sissom 5 years ago
parent
commit
1315c7b9e3
Signed by untrusted user who does not match committer: djsissom GPG Key ID: 2C30FFB796852389
1 changed files with 28 additions and 0 deletions
  1. + 28
    - 0
      vim/vimrc

+ 28
- 0
vim/vimrc

@ -105,12 +105,40 @@ endif
syntax spell toplevel
function! BuildYCM(info)
" info is a dictionary with 3 fields
" - name: name of the plugin
" - status: 'installed', 'updated', or 'unchanged'
" - force: set on PlugInstall! or PlugUpdate!
if a:info.status == 'installed' || a:info.force
!./install.py --all
endif
endfunction
let g:YouCompleteMeLazyLoaded = 0
function! LazyLoadingYMC()
if g:YouCompleteMeLazyLoaded == 0
let g:YouCompleteMeLazyLoaded = 1
call plug#load('YouCompleteMe') | call youcompleteme#Enable()
endif
endfunction
autocmd BufRead * call timer_start(1, {id->execute('call LazyLoadingYMC()')} )
"autocmd BufWinEnter * call timer_start(1, {id->execute('call LazyLoadingYMC()')} )
"autocmd InsertEnter * call LazyLoadingYMC()
"autocmd CursorHold * call LazyLoadingYMC()
"autocmd CursorHoldI * call LazyLoadingYMC()
call plug#begin('~/.vim/vim-plug')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM'), 'on': [] }
call plug#end()
map <C-n> :NERDTreeToggle<CR>
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 1

Loading…
Cancel
Save