call signature_help#enable() call popup_preview#enable() call ddc#custom#patch_global('sources', ['nvim-lsp', 'around', 'file']) call ddc#custom#patch_global('sourceOptions', { \ 'around': {'mark': 'A', 'maxSize': 500}, \ 'nvim-lsp': {'mark': 'L'}, \ 'file': { \ 'mark': 'F', \ 'isVolatile': v:true, \ 'forceCompletionPattern': '\S/\S*', \ }, \ '_': { \ 'matchers': ['matcher_head'], \ 'sorters': ['sorter_rank'], \ 'converters': ['converter_remove_overlap'], \ }, \ }) call ddc#custom#patch_global('completionMenu', 'pum.vim') " pum inoremap \ pum#visible() ? 'call pum#map#insert_relative(+1)' : \ (col('.') <= 1 getline('.')[col('.') - 2] =~# '\s') ? \ '' : ddc#manual_complete() inoremap call pum#map#insert_relative(-1) inoremap call pum#map#select_relative(+1) inoremap call pum#map#select_relative(-1) inoremap call pum#map#confirm() inoremap call pum#map#cancel() call ddc#custom#patch_global('autoCompleteEvents', [ \ 'InsertEnter', 'TextChangedI', 'TextChangedP', \ 'CmdlineEnter', 'CmdlineChanged', \ ]) nnoremap : call CommandlinePre(): function! CommandlinePre() abort " Note: It disables default command line completion! cnoremap \ pum#visible() ? 'call pum#map#insert_relative(+1)' : \ ddc#manual_complete() cnoremap call pum#map#insert_relative(-1) cnoremap call pum#map#confirm() cnoremap call pum#map#cancel() " Overwrite sources let s:prev_buffer_config = ddc#custom#get_buffer() call ddc#custom#patch_buffer('sources', \ ['cmdline', 'cmdline-history', 'around', 'file']) call ddc#custom#patch_buffer('sourceOptions', { \ 'file': { \ 'mark': 'F', \ 'isVolatile': v:true, \ 'forceCompletionPattern': '(^e\s+|\S/\S*)', \ }, \ }) autocmd User DDCCmdlineLeave ++once call CommandlinePost() " Enable command line completion call ddc#enable_cmdline_completion() call ddc#enable() endfunction function! CommandlinePost() abort " Restore sources call ddc#custom#set_buffer(s:prev_buffer_config) cunmap endfunction call ddc#enable()