1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 06:20:05 +08:00
SpaceVim/config/plugins/deoplete.vim

125 lines
4.1 KiB
VimL
Raw Normal View History

let g:deoplete#enable_at_startup = get(g:, 'deoplete#enable_at_startup', 1)
2018-10-06 10:15:19 +08:00
" deoplete options
let s:profile = SpaceVim#layers#autocomplete#getprfile()
call deoplete#custom#option({
\ 'auto_complete_delay' : g:_spacevim_autocomplete_delay,
\ 'ignore_case' : get(g:, 'deoplete#enable_ignore_case', 1),
\ 'smart_case' : get(g:, 'deoplete#enable_smart_case', 1),
\ 'camel_case' : get(g:, 'deoplete#enable_camel_case', 1),
\ 'refresh_always' : get(g:, 'deoplete#enable_refresh_always', 1)
\ })
" let g:deoplete#max_abbr_width = get(g:, 'deoplete#max_abbr_width', 0)
" let g:deoplete#max_menu_width = get(g:, 'deoplete#max_menu_width', 0)
2017-02-20 00:07:02 +08:00
" init deoplet option dict
let g:deoplete#ignore_sources = get(g:,'deoplete#ignore_sources',{})
2016-12-26 21:11:19 +08:00
let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})
2017-02-20 00:07:02 +08:00
let g:deoplete#omni_patterns = get(g:, 'deoplete#omni_patterns', {})
2017-11-05 19:09:55 +08:00
let g:deoplete#keyword_patterns = get(g:, 'deoplete#keyword_patterns', {})
2017-02-20 00:07:02 +08:00
" java && jsp
2018-10-06 10:15:19 +08:00
call deoplete#custom#var('omni', 'input_patterns', {
\ 'java': [
\ '[^. \t0-9]\.\w*',
\ '[^. \t0-9]\->\w*',
\ '[^. \t0-9]\::\w*',
\ ],
\ 'jsp': ['[^. \t0-9]\.\w*'],
\})
2017-02-20 00:07:02 +08:00
if g:spacevim_enable_javacomplete2_py
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'java': ['omni']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('javacomplete2', 'mark', '')
2017-02-20 00:07:02 +08:00
else
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'java': ['javacomplete2', 'around', 'member']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('omni', 'mark', '')
call deoplete#custom#source('omni', 'rank', 9999)
2017-02-20 00:07:02 +08:00
endif
2017-10-31 23:39:01 +08:00
" sh
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'sh': ['around', 'member', 'tag', 'syntax']})
2017-10-31 23:39:01 +08:00
2017-02-20 00:07:02 +08:00
" go
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'go': ['omni']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('go', 'mark', '')
call deoplete#custom#source('go', 'rank', 9999)
2017-02-20 00:07:02 +08:00
2017-08-29 05:23:16 +08:00
" markdown
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'markdown': ['tag']})
2017-08-29 05:23:16 +08:00
2017-02-20 00:07:02 +08:00
" perl
2018-10-06 10:15:19 +08:00
call deoplete#custom#var('omni', 'input_patterns', {
\ 'perl': [
\ '[^. \t0-9]\.\w*',
\ '[^. \t0-9]\->\w*',
\ '[^. \t0-9]\::\w*',
\ ],
\})
2017-02-20 00:07:02 +08:00
" javascript
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'javascript': ['omni']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('ternjs', 'mark', 'tern')
call deoplete#custom#source('ternjs', 'rank', 9999)
2017-02-20 00:07:02 +08:00
2017-09-11 21:32:11 +08:00
" typescript
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'typescript': ['tag','omni', 'syntax']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('typescript', 'rank', 9999)
2017-09-11 21:32:11 +08:00
2017-12-25 21:56:33 +08:00
" php two types, 1. phpcd (default) 2. lsp
if SpaceVim#layers#lsp#check_filetype('php')
if has('nvim')
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'php': ['omni', 'around', 'member']})
2017-12-25 21:56:33 +08:00
else
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'php': ['around', 'member']})
2017-12-25 21:56:33 +08:00
endif
else
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'php': ['omni', 'around', 'member']})
2017-12-25 21:56:33 +08:00
endif
2017-02-20 00:07:02 +08:00
2017-05-30 13:38:57 +08:00
" gitcommit
2018-10-06 10:15:19 +08:00
call deoplete#custom#var('omni', 'input_patterns', {
\ 'gitcommit': [
\ '[ ]#[ 0-9a-zA-Z]*',
\ ],
\})
2017-05-30 13:38:57 +08:00
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'gitcommit': ['neosnippet']})
2017-05-30 14:03:33 +08:00
2017-02-20 00:07:02 +08:00
" lua
let g:deoplete#omni_patterns.lua = get(g:deoplete#omni_patterns, 'lua', '.')
2017-02-20 00:07:02 +08:00
" c c++
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('clang2', 'mark', '')
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'c': ['omni']})
2017-02-20 00:07:02 +08:00
" rust
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'rust': ['omni']})
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('racer', 'mark', '')
2017-02-20 00:07:02 +08:00
2017-12-05 10:37:20 +08:00
" vim
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'vim': ['tag']})
2017-12-05 10:37:20 +08:00
2017-11-05 19:09:55 +08:00
" clojure
let g:deoplete#keyword_patterns.clojure = '[\w!$%&*+/:<=>?@\^_~\-\.#]*'
2018-02-07 13:49:44 +08:00
" ocaml
2018-10-06 10:15:19 +08:00
call deoplete#custom#option('ignore_sources', {'ocaml': ['buffer', 'around', 'omni']})
2018-02-07 13:49:44 +08:00
" erlang
2018-10-06 10:15:19 +08:00
call deoplete#custom#var('omni', 'input_patterns', {
\ 'erlang': [
\ '[^. \t0-9]\.\w*',
\ ],
\})
2017-02-20 00:07:02 +08:00
" public settings
2018-04-09 20:51:02 +08:00
call deoplete#custom#source('_', 'matchers', ['matcher_full_fuzzy'])
call deoplete#custom#source('file/include', 'matchers', ['matcher_head'])
2018-10-06 10:15:19 +08:00
2016-12-26 21:11:19 +08:00
inoremap <expr><C-h> deoplete#mappings#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#mappings#smart_close_popup()."\<C-h>"
set isfname-==
2017-03-06 23:26:26 +08:00
" vim:set et sw=2: