Add deoplete configuration

This commit is contained in:
ViViDboarder 2015-09-29 09:27:05 -07:00
parent 11833a5df4
commit 72e12c5ee3
6 changed files with 56 additions and 23 deletions

View File

@ -33,11 +33,15 @@ echo "Install all bundles"
vim +PlugInstall +qall vim +PlugInstall +qall
if hash nvim 2>/dev/null; then if hash nvim 2>/dev/null; then
nvim +PlugInstall +qall nvim +PlugInstall +qall
nvim +UpdateRemotePlugins +qall
fi fi
vim --version | grep -q '\+lua' || { echo "Warning: Default vim does not include lua"; }
vim --version | grep -q '\+ruby' || { echo "Warning: Default vim does not include ruby."; } vim --version | grep -q '\+ruby' || { echo "Warning: Default vim does not include ruby."; }
vim --version | grep -q '\+python' || { echo "Warning: Default vim does not include python"; } vim --version | grep -q '\+python' || { echo "Warning: Default vim does not include python"; }
echo "If using Neovim, install the python modules"
echo "All done!" echo "All done!"
exit 0 exit 0

View File

@ -79,9 +79,16 @@ command! Todo Grep TODO
" }} Fuzzy Find " }} Fuzzy Find
" Autocomplete {{ " Autocomplete {{
call s:smart_source_rc('plugins/omnicompletion')
if (has('lua') && (v:version > 703 || v:version == 703 && has('patch885'))) if (has('lua') && (v:version > 703 || v:version == 703 && has('patch885')))
Plug 'Shougo/neocomplete.vim' Plug 'Shougo/neocomplete.vim'
call s:smart_source_rc('plugins/neocomplete') call s:smart_source_rc('plugins/neocomplete')
elseif has('nvim') && has('python3')
Plug 'Shougo/deoplete.nvim'
Plug 'Shougo/neoinclude.vim'
Plug 'Shougo/neco-syntax'
call s:smart_source_rc('plugins/deoplete')
" Remember :UpdateRemotePlugins
else else
Plug 'Shougo/neocomplcache.vim' Plug 'Shougo/neocomplcache.vim'
call s:smart_source_rc('plugins/neocomplcache') call s:smart_source_rc('plugins/neocomplcache')
@ -184,8 +191,9 @@ nmap <silent><leader>ptm <Esc>:Pytest method<CR>
" }} pytest.vim " }} pytest.vim
Plug 'davidhalter/jedi-vim' Plug 'davidhalter/jedi-vim'
" jedi-vim {{ " jedi-vim {{
let g:jedi#completions_enabled = 0
let g:jedi#auto_vim_configuration = 0 let g:jedi#auto_vim_configuration = 0
let g:jedi#completions_enabled = 0
let g:jedi#smart_auto_mappings = 0
" }} jedi-vim " }} jedi-vim
Plug 'klen/python-mode' Plug 'klen/python-mode'
" python-mode {{ " python-mode {{

View File

@ -0,0 +1,35 @@
inoremap <silent><expr> <C-Space> pumvisible() ? "\<C-n>" : deoplete#mappings#manual_complete()
inoremap <silent><expr> <nul> pumvisible() ? "\<C-n>" : deoplete#mappings#manual_complete()
if !exists('g:deoplete#sources')
let g:deoplete#sources = {}
endif
if !exists('g:deoplete#keyword_patterns')
let g:deoplete#keyword_patterns = {}
endif
if !exists('g:deoplete#omni#input_patterns')
let g:deoplete#omni#input_patterns = {}
endif
" Set allowed sources
let g:deoplete#sources._ = ['buffer', 'member', 'file', 'tag'] ", 'omni']
let g:deoplete#sources.python = ['buffer', 'member', 'file', 'omni']
" Set default keyword pattern (vim regex)
let g:deoplete#keyword_patterns['default'] = '\h\w*'
" Set omni patters for deoplete (python3 regex)
let g:deoplete#omni#input_patterns.go = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:deoplete#omni#input_patterns.python = '([^. \t]\.|^\s*@|^\s*from\s.+ import |^\s*from |^\s*import )\w*'
" Default settings
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#auto_completion_start_length = 2
let g:deoplete#manual_completion_start_length = 0
" Be extra sure that jedi works
let g:jedi#auto_vim_configuration = 0
let g:jedi#completions_enabled = 0
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
let g:jedi#show_call_signatures = 0
let g:jedi#smart_auto_mappings = 0

View File

@ -1,5 +1,5 @@
let g:neocomplcache_enable_at_startup = 1 let g:neocomplcache_enable_at_startup = 1
"let g:neocomplcache_enable_smart_case = 1 let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_max_list = 10 let g:neocomplcache_max_list = 10
"let g:neocomplcache_enable_camel_case_completion = 1 "let g:neocomplcache_enable_camel_case_completion = 1
let g:neocomplcache_enable_fuzzy_completion = 1 let g:neocomplcache_enable_fuzzy_completion = 1
@ -30,13 +30,3 @@ if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {} let g:neocomplcache_keyword_patterns = {}
endif endif
let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+' let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+'
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" Skip python because we have jedi-vim
" autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal omnifunc=jedi#completions
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

View File

@ -1,6 +1,6 @@
let g:acp_enableAtStartup = 0 let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1 let g:neocomplete#enable_at_startup = 1
"let g:neocomplete#enable_smart_case = 1 let g:neocomplete#enable_smart_case = 1
let g:neocomlete#max_list=10 let g:neocomlete#max_list=10
let g:neocomplete#auto_completion_start_length = 2 let g:neocomplete#auto_completion_start_length = 2
let g:neocomplete#manual_completion_start_length = 0 let g:neocomplete#manual_completion_start_length = 0
@ -19,13 +19,3 @@ let g:neocomplete#force_omni_input_patterns['cpp'] = '[^.[:digit:] *\t]\%(\.\|->
let g:neocomplete#force_omni_input_patterns['go'] = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplete#force_omni_input_patterns['go'] = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplete#force_omni_input_patterns['python'] = let g:neocomplete#force_omni_input_patterns['python'] =
\ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*'
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" Skip python because we have jedi-vim
" autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal omnifunc=jedi#completions
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

View File

@ -0,0 +1,6 @@
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=jedi#completions
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags