diff --git a/vim/rc/plugins.rc.vim b/vim/rc/plugins.rc.vim index 94036a0..b1967a7 100644 --- a/vim/rc/plugins.rc.vim +++ b/vim/rc/plugins.rc.vim @@ -55,10 +55,10 @@ endif " Autocomplete {{ if has('lua') Plug 'Shougo/neocomplete.vim' - call s:smart_source_rc('plugins/neocomps') + call s:smart_source_rc('plugins/neocomplete') else Plug 'Shougo/neocomplcache.vim' - call s:smart_source_rc('plugins/neocomps') + call s:smart_source_rc('plugins/neocomplcache') end " Programming {{ diff --git a/vim/rc/plugins/neocomplcache.rc.vim b/vim/rc/plugins/neocomplcache.rc.vim new file mode 100644 index 0000000..19cd163 --- /dev/null +++ b/vim/rc/plugins/neocomplcache.rc.vim @@ -0,0 +1,40 @@ +let g:neocomplcache_enable_at_startup = 1 +"let g:neocomplcache_enable_smart_case = 1 +let g:neocomplcache_max_list = 10 +"let g:neocomplcache_enable_camel_case_completion = 1 +let g:neocomplcache_enable_fuzzy_completion = 1 +let g:neocomplcache_auto_completion_start_length = 2 +let g:neocomplcache_manual_completion_start_length = 0 + +" omni_patterns +if !exists('g:neocomplcache_omni_patterns') + let g:neocomplcache_omni_patterns = {} +endif + +" omni_functions +if !exists('g:neocomplcache_omni_functions') + let g:neocomplcache_omni_functions = {} +endif + +" force_omni_patterns +if !exists('g:neocomplcache_force_omni_patterns') + let g:neocomplcache_force_omni_patterns = {} +endif +let g:neocomplcache_force_omni_patterns['python'] = + \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' + +" keyword_patterns +if !exists('g:neocomplcache_keyword_patterns') + let g:neocomplcache_keyword_patterns = {} +endif +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 diff --git a/vim/rc/plugins/neocomplete.rc.vim b/vim/rc/plugins/neocomplete.rc.vim new file mode 100644 index 0000000..74db5b4 --- /dev/null +++ b/vim/rc/plugins/neocomplete.rc.vim @@ -0,0 +1,29 @@ +let g:acp_enableAtStartup = 0 +let g:neocomplete#enable_at_startup = 1 +"let g:neocomplete#enable_smart_case = 1 +let g:neocomlete#max_list=10 +let g:neocomplete#auto_completion_start_length = 2 +let g:neocomplete#manual_completion_start_length = 0 + +if !exists('g:neocomplete#keyword_patterns') + let g:neocomplete#keyword_patterns = {} +endif +let g:neocomplete#keyword_patterns['default'] = '\h\w*' +" let g:neocomplete#keyword_patterns['python'] = +" \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' + +if !exists('g:neocomplete#force_omni_input_patterns') + let g:neocomplete#force_omni_input_patterns = {} +endif +let g:neocomplete#force_omni_input_patterns['python'] = + \ '\%([^. \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 diff --git a/vim/rc/plugins/neocomps.rc.vim b/vim/rc/plugins/neocomps.rc.vim deleted file mode 100644 index 11a7bd0..0000000 --- a/vim/rc/plugins/neocomps.rc.vim +++ /dev/null @@ -1,29 +0,0 @@ -" Shared plugin configuration for Shougo/neocomplete and Shougo/neocomplcache -if exists('loaded_neocomplete') - let g:acp_enableAtStartup = 0 - let g:neocomplete#enable_at_startup = 1 - "let g:neocomplete#enable_smart_case = 1 - let g:neocomlete#max_list=10 -elseif exists('loaded_neocomplcache') - let g:neocomplcache_enable_at_startup = 1 - "let g:neocomplcache_enable_smart_case = 1 - let g:neocomplcache_max_list = 10 - "let g:neocomplcache_enable_camel_case_completion = 1 - let g:neocomplcache_enable_fuzzy_completion = 1 - if !exists('g:neocomplcache_force_omni_patterns') - let g:neocomplcache_force_omni_patterns = {} - endif - let g:neocomplcache_force_omni_patterns.python = - \ '\%([^. \t]\.\|^\s*@\|^\s*from\s.\+import \|^\s*from \|^\s*import \)\w*' - " alternative pattern: '\h\w*\|[^. \t]\.\w*' -endif - -" 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