diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 4d6f7440..f7424fd0 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -38,10 +38,6 @@ function! youcompleteme#Enable() return endif - if g:ycm_allow_changing_updatetime - set ut=2000 - endif - augroup youcompleteme autocmd! autocmd CursorMovedI * call s:OnCursorMovedInsertMode() @@ -68,6 +64,14 @@ function! youcompleteme#Enable() " Also, having this option set breaks the plugin. set completeopt-=longest + if g:ycm_add_preview_to_completeopt + set completeopt+=preview + endif + + if g:ycm_allow_changing_updatetime + set ut=2000 + endif + " With this command, when the completion window is visible, the tab key will " select the next candidate in the window. In vim, this also changes the " typed-in text to that of the candidate completion. diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index b73dd316..33eeb922 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -37,12 +37,16 @@ let g:ycm_min_num_of_chars_for_completion = let g:ycm_filetypes_to_ignore = \ get( g:, 'ycm_filetypes_to_ignore', { 'notes' : 1 } ) +" TODO: make this more granular let g:ycm_filetype_completion_enabled = \ get( g:, 'ycm_filetype_completion_enabled', 1 ) let g:ycm_allow_changing_updatetime = \ get( g:, 'ycm_allow_changing_updatetime', 1 ) +let g:ycm_add_preview_to_completeopt = + \ get( g:, 'ycm_add_preview_to_completeopt', 1 ) + " This is basic vim plugin boilerplate let s:save_cpo = &cpo