summaryrefslogtreecommitdiff
path: root/plugin/deoplete.vim
blob: e23885167a87851b2170bfbc2ec46d7ee3a788f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"=============================================================================
" FILE: deoplete.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license
"=============================================================================

if exists('g:loaded_deoplete')
  finish
endif
let g:loaded_deoplete = 1

" Global options definition.
if get(g:, 'deoplete#enable_at_startup', 0)
  function! s:deoplete_lazy_enable()
    autocmd! deoplete_lazy_enable
    augroup! deoplete_lazy_enable
    call deoplete#enable()
  endfunction
  augroup deoplete_lazy_enable
    autocmd!
    autocmd CursorHold * call s:deoplete_lazy_enable()
    autocmd InsertEnter * call s:deoplete_lazy_enable()
          \ | silent! doautocmd <nomodeline> deoplete InsertEnter
  augroup END
endif