From f805f76c9472aa55202551350ea6e1044ff6cf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 9 Mar 2015 20:13:51 +0100 Subject: [PATCH] Added NeoComplete plugin --- bundles-init/neocomplete.vim.cfg.vim | 52 +++++++++++++++++++++++++++ bundles-init/neocomplete.vim.load.vim | 1 + 2 files changed, 53 insertions(+) create mode 100644 bundles-init/neocomplete.vim.cfg.vim create mode 100644 bundles-init/neocomplete.vim.load.vim diff --git a/bundles-init/neocomplete.vim.cfg.vim b/bundles-init/neocomplete.vim.cfg.vim new file mode 100644 index 0000000..a60e2a8 --- /dev/null +++ b/bundles-init/neocomplete.vim.cfg.vim @@ -0,0 +1,52 @@ +let g:neocomplete#enable_at_startup = 1 +let g:neocomplete#enable_smart_case = 1 +let g:neocomplete#sources#syntax#min_keyword_length = 3 +let g:neocomplete#lock_buffer_name_pattern = '\*ku\*' + +let g:neocomplete#sources#dictionary#dictionaries = { + \ 'default' : '' +\ } + +if !exists( 'g:neocomplete#keyword_patterns' ) + let g:neocomplete#keyword_patterns = {} +endif +let g:neocomplete#keyword_patterns['default'] = '\h\w*' + +" Plugin key-mappings. +inoremap neocomplete#undo_completion() +inoremap neocomplete#complete_common_string() + +" Recommended key-mappings. +" : close popup and save indent. +inoremap =my_cr_function() +function! s:my_cr_function() + return neocomplete#close_popup() . "\" + " For no inserting key. + "return pumvisible() ? neocomplete#close_popup() : "\" +endfunction +" : completion. +inoremap pumvisible() ? "\" : "\" +" , : close popup and delete backword char. +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#smart_close_popup()."\" +inoremap neocomplete#close_popup() +inoremap neocomplete#cancel_popup() + +" 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 + +" Enable heavy omni completion. +if !exists('g:neocomplete#sources#omni#input_patterns') + let g:neocomplete#sources#omni#input_patterns = {} +endif +let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' +let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' +let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' + +" For perlomni.vim setting. +" https://github.com/c9s/perlomni.vim +let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' diff --git a/bundles-init/neocomplete.vim.load.vim b/bundles-init/neocomplete.vim.load.vim new file mode 100644 index 0000000..e1f3dbf --- /dev/null +++ b/bundles-init/neocomplete.vim.load.vim @@ -0,0 +1 @@ +NeoBundle 'Shougo/neocomplete'