Fix neocompletion with ruby
This commit is contained in:
parent
5978627032
commit
4ba95e6ff3
@ -1,5 +1,6 @@
|
|||||||
" neocomplcache
|
" neocomplcache
|
||||||
" A beter autocomplete system!
|
" A beter autocomplete system!
|
||||||
|
|
||||||
let g:neocomplcache_enable_at_startup = 1
|
let g:neocomplcache_enable_at_startup = 1
|
||||||
let g:neocomplcache_enable_camel_case_completion = 1
|
let g:neocomplcache_enable_camel_case_completion = 1
|
||||||
let g:neocomplcache_enable_underbar_completion = 1
|
let g:neocomplcache_enable_underbar_completion = 1
|
||||||
@ -11,8 +12,28 @@ let g:neocomplcache_max_list = 5
|
|||||||
" words less than 3 letters long aren't worth completing
|
" words less than 3 letters long aren't worth completing
|
||||||
let g:neocomplcache_auto_completion_start_length = 3
|
let g:neocomplcache_auto_completion_start_length = 3
|
||||||
|
|
||||||
" tab completion (from neocomplcache docs)
|
|
||||||
imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"
|
|
||||||
|
|
||||||
" Choose completions using Apple-Space
|
" Choose completions using Apple-Space
|
||||||
inoremap <expr><D-Space> pumvisible() ? "\<C-n>" : "\<TAB>"
|
inoremap <expr><D-Space> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||||
|
|
||||||
|
" This makes sure we use neocomplcache completefunc instead of
|
||||||
|
" the one in rails.vim, otherwise this plugin will crap out
|
||||||
|
let g:neocomplcache_force_overwrite_completefunc = 1
|
||||||
|
|
||||||
|
" Define keyword.
|
||||||
|
if !exists('g:neocomplcache_keyword_patterns')
|
||||||
|
let g:neocomplcache_keyword_patterns = {}
|
||||||
|
endif
|
||||||
|
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
|
||||||
|
|
||||||
|
" 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
|
||||||
|
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete
|
||||||
|
" Enable heavy omni completion.
|
||||||
|
if !exists('g:neocomplcache_omni_patterns')
|
||||||
|
let g:neocomplcache_omni_patterns = {}
|
||||||
|
endif
|
||||||
|
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
|
||||||
|
6
vimrc
6
vimrc
@ -51,7 +51,6 @@ set softtabstop=2
|
|||||||
set tabstop=2
|
set tabstop=2
|
||||||
set expandtab
|
set expandtab
|
||||||
set autoindent
|
set autoindent
|
||||||
set list listchars=tab:\ \ ,trail:·
|
|
||||||
|
|
||||||
" Prevent 'Press ENTER..' on error messages
|
" Prevent 'Press ENTER..' on error messages
|
||||||
set shortmess=atI
|
set shortmess=atI
|
||||||
@ -67,8 +66,7 @@ set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches
|
|||||||
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
|
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing
|
||||||
|
|
||||||
"display tabs and trailing spaces
|
"display tabs and trailing spaces
|
||||||
set list
|
set list listchars=tab:\ \ ,trail:·
|
||||||
set listchars=tab:\ \ ,extends:>,precedes:<
|
|
||||||
|
|
||||||
set formatoptions-=o "dont continue comments when pushing o/O
|
set formatoptions-=o "dont continue comments when pushing o/O
|
||||||
|
|
||||||
@ -122,4 +120,6 @@ set viminfo='100,f1
|
|||||||
|
|
||||||
" prevent auto insert mode, which is helpful when using conque
|
" prevent auto insert mode, which is helpful when using conque
|
||||||
" term for running tests
|
" term for running tests
|
||||||
|
"
|
||||||
autocmd WinEnter * stopinsert
|
autocmd WinEnter * stopinsert
|
||||||
|
"autocmd WinEnter * NeoComplCacheEnable
|
||||||
|
Loading…
Reference in New Issue
Block a user