Skip to content

Commit

Permalink
Add new vim plugin neocomplcache
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelzoech committed Mar 30, 2012
1 parent 3888e98 commit 220c67d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -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
1 change: 1 addition & 0 deletions vim/bundle/neocomplcache
Submodule neocomplcache added at 0f8c31
48 changes: 48 additions & 0 deletions vimrc
Expand Up @@ -14,6 +14,9 @@ Bundle 'gmarik/vundle'
Bundle 'vim-coffee-script'
Bundle 'xml.vim'

" Github
Bundle 'Shougo/neocomplcache'

filetype plugin indent on
syntax on

Expand Down Expand Up @@ -102,3 +105,48 @@ map <Leader>f :b
" Typing 'jj' fast enough switches from insert to command mode
inoremap jj <Esc>
" 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 <expr> <C-g> neocomplcache#undo_completion()
inoremap <expr> <C-l> neocomplcache#complete_common_string()
inoremap <expr> <CR> pumvisible() ? neocomplcache#close_popup() : "\<CR>"
"inoremap <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr> <C-h> neocomplcache#smart_close_popup()."\<C-h>"
inoremap <expr> <BS> neocomplcache#smart_close_popup()."\<C-h>"
"inoremap <expr> <C-y> neocomplcache#close_popup()
inoremap <expr> <C-e> 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*::'

0 comments on commit 220c67d

Please sign in to comment.