@@ -73,7 +73,7 @@ OPTIONS *ddc-options*
73
73
Options can be toggled through the use of | ddc#custom#patch_global() | .
74
74
75
75
For example:
76
- >
76
+ >vim
77
77
" Set a single option
78
78
call ddc#custom#patch_global('ui' , 'native' )
79
79
@@ -131,7 +131,7 @@ cmdlineSources
131
131
https://github.com/Shougo/ddc-ui-pum
132
132
133
133
Default: []
134
- >
134
+ >vim
135
135
" e.g.
136
136
call ddc#custom#patch_global('cmdlineSources', {
137
137
\ ':': ['cmdline-history', 'cmdline' , 'around' ],
@@ -159,7 +159,7 @@ filterOptions
159
159
See also | ddc-filter-options | .
160
160
161
161
Default: {}
162
- >
162
+ >vim
163
163
" e.g.
164
164
call ddc#custom#patch_global('filterOptions', #{
165
165
\ matcher_head: {},
@@ -170,7 +170,7 @@ filterParams
170
170
It is a dictionary that maps filter names to its parameters.
171
171
172
172
Default: {}
173
- >
173
+ >vim
174
174
" e.g.
175
175
call ddc#custom#patch_global('filterParams', #{
176
176
\ matcher_head: {},
@@ -201,7 +201,7 @@ postFilters
201
201
*ddc-option-sources*
202
202
sources
203
203
It is a list of elements which are formatted as:
204
- >
204
+ >vim
205
205
#{
206
206
name: {source-name} ,
207
207
options: {source-options} ,
@@ -213,7 +213,7 @@ sources
213
213
indexes.
214
214
215
215
Default: []
216
- >
216
+ >vim
217
217
" e.g.
218
218
call ddc#custom#patch_global('sources' , ['around' ])
219
219
<
@@ -225,7 +225,7 @@ sourceOptions
225
225
See also | ddc-source-options | .
226
226
227
227
Default: {}
228
- >
228
+ >vim
229
229
" e.g.
230
230
call ddc#custom#patch_global('sourceOptions', #{
231
231
\ _: #{ matchers: ['matcher_head'] },
@@ -238,7 +238,7 @@ sourceParams
238
238
See also | ddc-source-params | .
239
239
240
240
Default: {}
241
- >
241
+ >vim
242
242
" e.g.
243
243
call ddc#custom#patch_global('sourceParams', #{
244
244
\ around: #{ max: 8 },
@@ -350,7 +350,7 @@ ddc#hide([{event}])
350
350
"Initialize" or "Update".
351
351
NOTE: It is used to cancel the completion.
352
352
NOTE: It does not restore inserted text.
353
- >
353
+ >vim
354
354
inoremap <C-e> <Cmd> call ddc#hide()<CR>
355
355
<
356
356
*ddc#on_complete_done()*
@@ -414,7 +414,7 @@ ddc#custom#alias({type}, {alias-name}, {base-name})
414
414
Define {alias-name} alias based on {base-name} .
415
415
{type} must be "source" or "filter".
416
416
NOTE: It must be called before sources/filters initialization.
417
- >
417
+ >vim
418
418
call ddc#custom#alias('source' , 'foo' , 'around' )
419
419
call ddc#custom#patch_global('sources' , ['foo' ])
420
420
call ddc#custom#patch_global('sourceOptions', #{
@@ -511,7 +511,7 @@ ddc#custom#set_context_filetype({filetype}, {func})
511
511
dictionary.
512
512
NOTE: {func} is evaluated after user input and it affects
513
513
completion performance.
514
- >
514
+ >vim
515
515
call ddc#custom#set_context_filetype('go' , { ->
516
516
\ ddc#syntax#in('TSComment') ? {
517
517
\ 'sources' : ['nextword' , 'around' ],
@@ -596,7 +596,7 @@ NOTE: You can call events manually by |ddc#on_event()|.
596
596
597
597
==============================================================================
598
598
EXAMPLES *ddc-examples*
599
- >
599
+ >vim
600
600
" Customize global settings
601
601
602
602
" You must set the default ui.
@@ -1333,15 +1333,15 @@ Q: I want to use inline suggestion like fish shell.
1333
1333
A: NOTE: "ddc-ui-inline" is required.
1334
1334
1335
1335
https://github.com/Shougo/ddc-ui-inline
1336
- >
1336
+ >vim
1337
1337
inoremap <expr> <C-t> ddc#map#insert_item(0)
1338
1338
call ddc#custom#patch_global('ui' , 'inline' )
1339
1339
<
1340
1340
*ddc-faq-5*
1341
1341
Q: The Linked/chained completion exists like vim-mucomplete?
1342
1342
1343
1343
A: It is not implemented, but you can emulate the behavior by
1344
- | ddc#map#manual_complete() | like this. >
1344
+ | ddc#map#manual_complete() | like this. >vim
1345
1345
1346
1346
let g:chains = ['around' , 'zsh' , 'deoppet' ]
1347
1347
function MyChainCompletion() abort
@@ -1356,14 +1356,14 @@ Q: I want to silence the |ins-completion-menu| messages in the command line
1356
1356
such as "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern
1357
1357
not found", "Back at original", etc.
1358
1358
1359
- A: You can disable the messages through the 'shortmess' option. >
1359
+ A: You can disable the messages through the 'shortmess' option. >vim
1360
1360
1361
1361
set shortmess+=c
1362
1362
<
1363
1363
*ddc-faq-7*
1364
1364
Q: I want to use the auto select feature.
1365
1365
1366
- A: You can use it by the 'completeopt' option. >
1366
+ A: You can use it by the 'completeopt' option. >vim
1367
1367
1368
1368
set completeopt+=noinsert
1369
1369
<
@@ -1375,11 +1375,11 @@ A: Please press <C-y> on the item.
1375
1375
*ddc-faq-9*
1376
1376
Q: I want to close the preview window after completion is done.
1377
1377
1378
- A: >
1378
+ A: >vim
1379
1379
autocmd CompleteDone * silent! pclose!
1380
1380
<
1381
1381
Or
1382
- >
1382
+ >vim
1383
1383
autocmd InsertLeave * silent! pclose!
1384
1384
<
1385
1385
NOTE: It conflicts with delimitMate.
1388
1388
*ddc-faq-10*
1389
1389
Q: I want to disable the preview window feature.
1390
1390
1391
- A: >
1391
+ A: >vim
1392
1392
set completeopt-=preview
1393
1393
<
1394
1394
*ddc-faq-11*
@@ -1445,7 +1445,7 @@ https://github.com/LumaKernel/ddc-source-file
1445
1445
*ddc-faq-14*
1446
1446
Q: I want to enable "skkeleton" source when "skkeleton" is enabled only.
1447
1447
1448
- A: >
1448
+ A: >vim
1449
1449
autocmd User skkeleton-enable-pre call s:skkeleton_pre()
1450
1450
function s:skkeleton_pre() abort
1451
1451
" Overwrite sources
@@ -1470,7 +1470,7 @@ https://github.com/Shougo/pum.vim
1470
1470
https://github.com/Shougo/ddc-ui-pum
1471
1471
https://github.com/Shougo/ddc-source-cmdline
1472
1472
https://github.com/Shougo/ddc-source-cmdline-history
1473
- >
1473
+ >vim
1474
1474
call ddc#custom#patch_global(#{
1475
1475
\ ui: 'pum' ,
1476
1476
\ autoCompleteEvents: [
@@ -1514,7 +1514,7 @@ NOTE: Both "pum.vim" and "ddc-ui-pum" are required.
1514
1514
https://github.com/Shougo/pum.vim
1515
1515
https://github.com/Shougo/ddc-ui-pum
1516
1516
https://github.com/Shougo/ddc-source-input
1517
- >
1517
+ >vim
1518
1518
call ddc#custom#patch_global(#{
1519
1519
\ ui: 'pum' ,
1520
1520
\ autoCompleteEvents: [
@@ -1536,7 +1536,7 @@ https://github.com/hrsh7th/nvim-cmp/issues/309#issuecomment-940740456
1536
1536
Q: I want to enable auto completion in fine-cmdline.nvim
1537
1537
https://github.com/VonHeikemen/fine-cmdline.nvim
1538
1538
1539
- A: NOTE: Experimental >
1539
+ A: NOTE: Experimental >vim
1540
1540
1541
1541
lua <<EOF
1542
1542
require('fine-cmdline').setup({
@@ -1583,15 +1583,15 @@ Q: I want to disable ddc auto completion.
1583
1583
A: You need to set ui manually.
1584
1584
https://github.com/Shougo/ddc-ui-none
1585
1585
https://github.com/Shougo/ddc-ui-native
1586
- >
1586
+ >vim
1587
1587
call ddc#custom#patch_global('ui' , 'none' )
1588
1588
inoremap <expr> <TAB> ddc#map#complete('native' )
1589
1589
1590
1590
If you want to use "pum.vim".
1591
1591
https://github.com/Shougo/ddc-ui-none
1592
1592
https://github.com/Shougo/ddc-ui-pum
1593
1593
https://github.com/Shougo/pum.vim
1594
- >
1594
+ >vim
1595
1595
call ddc#custom#patch_global('ui' , 'none' )
1596
1596
inoremap <expr> <TAB> ddc#map#complete('pum' )
1597
1597
call ddc#custom#patch_global('uiParams', #{
@@ -1625,7 +1625,7 @@ If you really want to need the completion, please enable
1625
1625
*ddc-faq-23*
1626
1626
Q: "copilot.vim" does not work when ddc.vim popup is visible.
1627
1627
1628
- A: "copilot.vim" checks | pumvisible() | . You should disable it. >
1628
+ A: "copilot.vim" checks | pumvisible() | . You should disable it. >vim
1629
1629
1630
1630
let g:copilot_hide_during_completion = 0
1631
1631
<
@@ -1639,7 +1639,7 @@ You need to enable |ddc-option-specialBufferCompletion| for it.
1639
1639
Q: I want to narrow current items without auto completion.
1640
1640
1641
1641
A: You can narrow current items by "ddu.vim" like this.
1642
- >
1642
+ >vim
1643
1643
inoremap <C-l> <Cmd> call ddu#start(#{
1644
1644
\ name: 'ddc' ,
1645
1645
\ ui: 'ff' ,
@@ -1670,7 +1670,7 @@ NOTE: Use "deol.nvim" and "ddc-source-zsh" is recommend.
1670
1670
https://github.com/Shougo/deol.nvim
1671
1671
https://github.com/Shougo/ddc-source-zsh
1672
1672
1673
- >
1673
+ >vim
1674
1674
call ddc#custom#patch_global('autoCompleteEvents', [
1675
1675
\ 'InsertEnter', 'TextChangedI', 'TextChangedP',
1676
1676
\ 'CmdlineEnter', 'CmdlineChanged', 'TextChangedT',
@@ -1707,7 +1707,7 @@ Q: The |:normal| command is slow from command line.
1707
1707
1708
1708
A: Many | InsertEnter | , | InsertLeave | and | ModeChanged | autocmds are fired.
1709
1709
Unfortunately, ddc.vim cannot detect that it is executed from command line.
1710
- You should use | :noautocmd | like this. >
1710
+ You should use | :noautocmd | like this. >vim
1711
1711
:noautocmd %normal Itest
1712
1712
<
1713
1713
*ddc-faq-29*
@@ -1723,13 +1723,15 @@ https://github.com/Milly/ddc-unprintable
1723
1723
*ddc-faq-30*
1724
1724
Q: I want to use "inline" UI when there's single item.
1725
1725
1726
- A: You can use | ddc-option-dynamicUi | for it. >
1726
+ A: You can use | ddc-option-dynamicUi | for it. >vim
1727
1727
args.contextBuilder.patchGlobal({
1728
1728
dynamicUi: (_denops: Denops, args: Record<string, unknown>) => {
1729
1729
const uiArgs = args as {
1730
1730
items: DdcItem[],
1731
1731
};
1732
- return Promise.resolve(uiArgs.items.length == 1 ? "inline" : "pum");
1732
+ return Promise.resolve(
1733
+ uiArgs.items.length == 1 ? "inline" : "pum"
1734
+ );
1733
1735
},
1734
1736
});
1735
1737
<
0 commit comments