quinoa42
2017-12-22 20:19:39 +08:00
港真,deoplete 简单好用,为什么一定得用 YCM 呢
```
Plug 'Shougo/deoplete.nvim', { 'do' : ':UpdateRemotePlugins' }
Plug 'Shougo/echodoc.vim'
if executable('clang')
Plug 'tweekmonster/deoplete-clang2', { 'for' : ['c', 'cpp'] }
endif
Plug 'OmniSharp/omnisharp-vim', { 'do': 'cd server && xbuild', 'for' : 'cs' }
\ | Plug 'tpope/vim-dispatch', { 'for' : 'cs' }
\ | Plug 'dimixar/deoplete-omnisharp', { 'for' : 'cs' }
Plug 'artur-shaik/vim-javacomplete2', { 'for' : 'java' }
Plug 'zchee/deoplete-jedi', { 'for' : 'python' }
Plug 'fishbullet/deoplete-ruby', { 'for' : 'ruby' }
Plug 'Shougo/neco-vim', { 'for' : 'vim' }
```
```
if has("nvim")
" enable deoplete
let g:deoplete#enable_at_startup=1
" <TAB>: completion.
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" even show when there is only one result
set completeopt=longest,menuone
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
if !exists('g:deoplete#omni#input_patterns')
let g:deoplete#omni#input_patterns = {}
endif
let g:deoplete#ignore_sources = {}
let g:deoplete#ignore_sources._ = ['buffer', 'javacomplete2']
let g:deoplete#omni#functions = {}
let g:deoplete#omni#input_patterns.tex = g:vimtex#re#deoplete
let g:deoplete#omni#input_patterns.java = [
\'[^. \t0-9]\.\w*',
\'[^. \t0-9]\->\w*',
\'[^. \t0-9]\::\w*',
\]
let g:deoplete#omni#input_patterns.jsp = ['[^. \t0-9]\.\w*']
endif
if has("patch-7.4.314")
set shortmess+=c
endif
let g:echodoc_enable_at_startup=1
```