summaryrefslogtreecommitdiffstats
path: root/.vimrc
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-10-19 11:54:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-10-19 11:56:03 +0200
commit836b76e4819c1379457b16f10014f089d5776cd5 (patch)
tree3916b4a6849f3528fd8a260c11948239c4d1d13d /.vimrc
parent4d4d2301912173048475fb7a4874b5b18f9c7bd0 (diff)
downloaddotfiles-836b76e4819c1379457b16f10014f089d5776cd5.tar.gz
dotfiles-836b76e4819c1379457b16f10014f089d5776cd5.tar.xz
update vim plugins; add neocomplete
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc45
1 files changed, 43 insertions, 2 deletions
diff --git a/.vimrc b/.vimrc
index a97c9ab..b493383 100644
--- a/.vimrc
+++ b/.vimrc
@@ -50,7 +50,8 @@ set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'scrooloose/syntastic'
-Bundle 'Valloric/YouCompleteMe'
+"Bundle 'Valloric/YouCompleteMe'
+Bundle 'Shougo/neocomplete.vim'
Bundle 'SirVer/ultisnips'
Bundle 'tpope/vim-unimpaired'
Bundle 'tpope/vim-fugitive'
@@ -114,7 +115,47 @@ let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
-nmap <silent> ,s :set spell!<CR>
+let g:acp_enableAtStartup = 0
+let g:neocomplcache_enable_at_startup = 1
+" Use smartcase.
+let g:neocomplcache_enable_smart_case = 1
+" Set minimum syntax keyword length.
+let g:neocomplcache_min_syntax_length = 2
+
+" <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 heavy omni completion.
+if !exists('g:neocomplcache_omni_patterns')
+ let g:neocomplcache_omni_patterns = {}
+endif
+let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
+let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
+let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
+
+" For perlomni.vim setting.
+" https://github.com/c9s/perlomni.vim
+let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
+
+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 make setlocal noexpandtab
au FileType python set ts=4 sw=4 softtabstop=4 et