Skip to content

Commit ce0d5ce

Browse files
committed
Merge pull request spf13#537 from perfectworks/noOmniComplete
add a switch to disable omni complete
2 parents 2030f7e + 4ec01f5 commit ce0d5ce

File tree

2 files changed

+31
-22
lines changed

2 files changed

+31
-22
lines changed

.vimrc

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -408,28 +408,32 @@
408408
" }
409409

410410
" OmniComplete {
411-
if has("autocmd") && exists("+omnifunc")
412-
autocmd Filetype *
413-
\if &omnifunc == "" |
414-
\setlocal omnifunc=syntaxcomplete#Complete |
415-
\endif
416-
endif
411+
" To disable omni complete, add the following to your .vimrc.before.local file:
412+
" let g:spf13_no_omni_complete = 1
413+
if !exists('g:spf13_no_omni_complete')
414+
if has("autocmd") && exists("+omnifunc")
415+
autocmd Filetype *
416+
\if &omnifunc == "" |
417+
\setlocal omnifunc=syntaxcomplete#Complete |
418+
\endif
419+
endif
417420

418-
hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
419-
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
420-
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
421-
422-
" Some convenient mappings
423-
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
424-
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
425-
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
426-
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
427-
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
428-
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
429-
430-
" Automatically open and close the popup menu / preview window
431-
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
432-
set completeopt=menu,preview,longest
421+
hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
422+
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
423+
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
424+
425+
" Some convenient mappings
426+
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
427+
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
428+
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
429+
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
430+
inoremap <expr> <C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
431+
inoremap <expr> <C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
432+
433+
" Automatically open and close the popup menu / preview window
434+
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
435+
set completeopt=menu,preview,longest
436+
endif
433437
" }
434438

435439
" Ctags {
@@ -772,7 +776,9 @@
772776
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
773777
" }
774778
" Normal Vim omni-completion {
775-
else
779+
" To disable omni complete, add the following to your .vimrc.before.local file:
780+
" let g:spf13_no_omni_complete = 1
781+
elseif !exists('g:spf13_no_omni_complete')
776782
" Enable omni-completion.
777783
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
778784
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags

.vimrc.before

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
" To set your own font, do it from ~/.vimrc.local
7777
" let g:spf13_no_big_font = 1
7878

79+
" Disable omni complete
80+
" let g:spf13_no_omni_complete = 1
81+
7982
" Don't create default mappings for multicursors
8083
" See :help multiple-cursors-mappings
8184
" let g:multi_cursor_use_default_mapping=0

0 commit comments

Comments
 (0)