aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2015-02-28 16:55:40 +0100
committerDuncaen <mail@duncano.de>2015-02-28 16:55:40 +0100
commit3f0093d7b54144834ad44252279cb0c8fb9f2232 (patch)
treedb94f5dc6044885f630f23c5adc6843de3cc9432
parent7f86cae80b81e3b4d4387c2e81673b3a41f4d748 (diff)
downloaddotfiles-3f0093d7b54144834ad44252279cb0c8fb9f2232.tar.gz
neocomplcache: add settings
-rw-r--r--vim/settings/neocomplcache.vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/vim/settings/neocomplcache.vim b/vim/settings/neocomplcache.vim
new file mode 100644
index 0000000..0fca234
--- /dev/null
+++ b/vim/settings/neocomplcache.vim
@@ -0,0 +1,38 @@
+let g:neocomplcache_enable_at_startup = 1
+
+" Plugin key-mappings.
+inoremap <expr><C-g> neocomplcache#undo_completion()
+inoremap <expr><C-l> neocomplcache#complete_common_string()
+
+" Recommended key-mappings.
+" <CR>: close popup and save indent.
+inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
+function! s:my_cr_function()
+ return neocomplcache#smart_close_popup() . "\<CR>"
+ " For no inserting <CR> key.
+ "return pumvisible() ? neocomplcache#close_popup() : "\<CR>"
+endfunction
+" <TAB>: completion.
+inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+" <C-h>, <BS>: close popup and delete backword char.
+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()
+" Close popup by <Space>.
+"inoremap <expr><Space> pumvisible() ? neocomplcache#close_popup() : "\<Space>"
+
+" 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:neocomplcache_force_omni_patterns')
+ let g:neocomplcache_force_omni_patterns = {}
+endif
+let g:neocomplcache_force_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
+let g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
+let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'