From 220c67d41b12092f8c4d82d74b15173dae540584 Mon Sep 17 00:00:00 2001 From: Michael Zoech Date: Fri, 30 Mar 2012 11:05:56 +0200 Subject: [PATCH] Add new vim plugin neocomplcache --- .gitmodules | 3 +++ vim/bundle/neocomplcache | 1 + vimrc | 48 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 160000 vim/bundle/neocomplcache diff --git a/.gitmodules b/.gitmodules index b83cf71..9c31e1a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "autojump"] path = autojump url = https://github.com/joelthelion/autojump.git +[submodule "vim/bundle/neocomplcache"] + path = vim/bundle/neocomplcache + url = https://github.com/Shougo/neocomplcache.git diff --git a/vim/bundle/neocomplcache b/vim/bundle/neocomplcache new file mode 160000 index 0000000..0f8c31b --- /dev/null +++ b/vim/bundle/neocomplcache @@ -0,0 +1 @@ +Subproject commit 0f8c31b0dded4b955930fbf22c61d1f1fd9fb79c diff --git a/vimrc b/vimrc index 2f40220..d49ad08 100644 --- a/vimrc +++ b/vimrc @@ -14,6 +14,9 @@ Bundle 'gmarik/vundle' Bundle 'vim-coffee-script' Bundle 'xml.vim' +" Github +Bundle 'Shougo/neocomplcache' + filetype plugin indent on syntax on @@ -102,3 +105,48 @@ map f :b " Typing 'jj' fast enough switches from insert to command mode inoremap jj +" neocomplcache plugin +let g:acp_enableAtStartup = 0 +let g:neocomplcache_enable_at_startup = 1 +let g:neocomplcache_enable_smart_case = 1 +let g:neocomplcache_enable_camel_case_completion = 1 +let g:neocomplcache_enable_underbar_completion = 1 +let g:neocomplcache_min_syntax_length = 3 +let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' +let g:neocomplcache_enable_auto_select = 1 + +" Define dictionary. +let g:neocomplcache_dictionary_filetype_lists = { + \ 'default' : '', + \ 'vimshell' : $HOME.'/.vimshell_hist', + \ 'scheme' : $HOME.'/.gosh_completions' + \ } + +" Define keyword. +if !exists('g:neocomplcache_keyword_patterns') + let g:neocomplcache_keyword_patterns = {} +endif +let g:neocomplcache_keyword_patterns['default'] = '\h\w*' + +inoremap neocomplcache#undo_completion() +inoremap neocomplcache#complete_common_string() +inoremap pumvisible() ? neocomplcache#close_popup() : "\" +"inoremap pumvisible() ? "\" : "\" +inoremap neocomplcache#smart_close_popup()."\" +inoremap neocomplcache#smart_close_popup()."\" +"inoremap neocomplcache#close_popup() +inoremap neocomplcache#cancel_popup() + +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 + +if !exists('g:neocomplcache_omni_patterns') + let g:neocomplcache_omni_patterns = {} +endif +let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' +let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*' +let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::' +