2022-07-18 15:36:58 +00:00
|
|
|
" Customize global settings
|
2023-01-02 13:00:47 +00:00
|
|
|
|
|
|
|
" You must set the default ui.
|
|
|
|
" Note: native ui
|
|
|
|
" https://github.com/Shougo/ddc-ui-native"
|
|
|
|
call ddc#custom#patch_global('ui', 'native')
|
|
|
|
|
2022-07-18 15:36:58 +00:00
|
|
|
" Use around source.
|
|
|
|
" https://github.com/Shougo/ddc-around
|
|
|
|
call ddc#custom#patch_global('sources', ['around'])
|
|
|
|
|
|
|
|
" Use matcher_head and sorter_rank.
|
|
|
|
" https://github.com/Shougo/ddc-matcher_head
|
|
|
|
" https://github.com/Shougo/ddc-sorter_rank
|
|
|
|
call ddc#custom#patch_global('sourceOptions', {
|
|
|
|
\ '_': {
|
|
|
|
\ 'matchers': ['matcher_head'],
|
|
|
|
\ 'sorters': ['sorter_rank']},
|
|
|
|
\ })
|
|
|
|
|
|
|
|
" Change source options
|
|
|
|
call ddc#custom#patch_global('sourceOptions', {
|
|
|
|
\ 'around': {'mark': 'A'},
|
|
|
|
\ })
|
|
|
|
call ddc#custom#patch_global('sourceParams', {
|
|
|
|
\ 'around': {'maxSize': 500},
|
|
|
|
\ })
|
|
|
|
|
|
|
|
" Customize settings on a filetype
|
|
|
|
call ddc#custom#patch_filetype(['c', 'cpp'], 'sources', ['around', 'clangd'])
|
|
|
|
call ddc#custom#patch_filetype(['c', 'cpp'], 'sourceOptions', {
|
|
|
|
\ 'clangd': {'mark': 'C'},
|
|
|
|
\ })
|
|
|
|
call ddc#custom#patch_filetype('markdown', 'sourceParams', {
|
|
|
|
\ 'around': {'maxSize': 100},
|
|
|
|
\ })
|
|
|
|
|
2023-04-04 09:38:34 +00:00
|
|
|
" " Mappings
|
|
|
|
" " <TAB>: completion.
|
|
|
|
" inoremap <silent><expr> <TAB>
|
|
|
|
" \ ddc#map#pum_visible() ? '<C-n>' :
|
|
|
|
" \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ?
|
|
|
|
" \ '<TAB>' : ddc#map#manual_complete()
|
|
|
|
|
|
|
|
" " <S-TAB>: completion back.
|
|
|
|
" inoremap <expr><S-TAB> ddc#map#pum_visible() ? '<C-p>' : '<C-h>'
|
2022-07-18 15:36:58 +00:00
|
|
|
|
|
|
|
" Use ddc.
|
|
|
|
call ddc#enable()
|
2023-01-02 13:00:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
" vim:ft=vim
|