2011-12-13 10:21:42 +08:00
|
|
|
" neocomplcache
|
|
|
|
" A beter autocomplete system!
|
2011-12-16 12:01:18 +08:00
|
|
|
|
2011-12-13 10:21:42 +08:00
|
|
|
let g:neocomplcache_enable_at_startup = 1
|
|
|
|
let g:neocomplcache_enable_camel_case_completion = 1
|
|
|
|
let g:neocomplcache_enable_underbar_completion = 1
|
2011-12-13 12:42:54 +08:00
|
|
|
let g:neocomplcache_enable_smart_case = 1
|
|
|
|
|
|
|
|
" default # of completions is 100, that's crazy
|
2011-12-16 12:01:18 +08:00
|
|
|
let g:neocomplcache_max_list = 5
|
2011-12-13 12:42:54 +08:00
|
|
|
|
|
|
|
" words less than 3 letters long aren't worth completing
|
|
|
|
let g:neocomplcache_auto_completion_start_length = 3
|
|
|
|
|
2011-12-16 15:24:22 +08:00
|
|
|
" Map standard Ctrl-N completion to Cmd-Space
|
|
|
|
inoremap <D-Space> <C-n>
|
2011-12-16 12:01:18 +08:00
|
|
|
|
|
|
|
" This makes sure we use neocomplcache completefunc instead of
|
|
|
|
" the one in rails.vim, otherwise this plugin will crap out
|
|
|
|
let g:neocomplcache_force_overwrite_completefunc = 1
|
|
|
|
|
|
|
|
" Define keyword.
|
|
|
|
if !exists('g:neocomplcache_keyword_patterns')
|
|
|
|
let g:neocomplcache_keyword_patterns = {}
|
|
|
|
endif
|
|
|
|
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
|
2011-12-13 10:21:42 +08:00
|
|
|
|
2011-12-16 12:01:18 +08:00
|
|
|
" 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
|
|
|
|
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
|
|
|
|
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
|
|
|
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
|
|
|
|
" Enable heavy omni completion.
|
|
|
|
if !exists('g:neocomplcache_omni_patterns')
|
|
|
|
let g:neocomplcache_omni_patterns = {}
|
|
|
|
endif
|
|
|
|
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
|