Skip to content

Commit c760d4a

Browse files
committed
Add annotation
1 parent 8e6963b commit c760d4a

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

doc/ddc.txt

+33-31
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ OPTIONS *ddc-options*
7373
Options can be toggled through the use of |ddc#custom#patch_global()|.
7474

7575
For example:
76-
>
76+
>vim
7777
" Set a single option
7878
call ddc#custom#patch_global('ui', 'native')
7979

@@ -131,7 +131,7 @@ cmdlineSources
131131
https://github.com/Shougo/ddc-ui-pum
132132

133133
Default: []
134-
>
134+
>vim
135135
" e.g.
136136
call ddc#custom#patch_global('cmdlineSources', {
137137
\ ':': ['cmdline-history', 'cmdline', 'around'],
@@ -159,7 +159,7 @@ filterOptions
159159
See also |ddc-filter-options|.
160160

161161
Default: {}
162-
>
162+
>vim
163163
" e.g.
164164
call ddc#custom#patch_global('filterOptions', #{
165165
\ matcher_head: {},
@@ -170,7 +170,7 @@ filterParams
170170
It is a dictionary that maps filter names to its parameters.
171171

172172
Default: {}
173-
>
173+
>vim
174174
" e.g.
175175
call ddc#custom#patch_global('filterParams', #{
176176
\ matcher_head: {},
@@ -201,7 +201,7 @@ postFilters
201201
*ddc-option-sources*
202202
sources
203203
It is a list of elements which are formatted as:
204-
>
204+
>vim
205205
#{
206206
name: {source-name},
207207
options: {source-options},
@@ -213,7 +213,7 @@ sources
213213
indexes.
214214

215215
Default: []
216-
>
216+
>vim
217217
" e.g.
218218
call ddc#custom#patch_global('sources', ['around'])
219219
<
@@ -225,7 +225,7 @@ sourceOptions
225225
See also |ddc-source-options|.
226226

227227
Default: {}
228-
>
228+
>vim
229229
" e.g.
230230
call ddc#custom#patch_global('sourceOptions', #{
231231
\ _: #{ matchers: ['matcher_head'] },
@@ -238,7 +238,7 @@ sourceParams
238238
See also |ddc-source-params|.
239239

240240
Default: {}
241-
>
241+
>vim
242242
" e.g.
243243
call ddc#custom#patch_global('sourceParams', #{
244244
\ around: #{ max: 8 },
@@ -350,7 +350,7 @@ ddc#hide([{event}])
350350
"Initialize" or "Update".
351351
NOTE: It is used to cancel the completion.
352352
NOTE: It does not restore inserted text.
353-
>
353+
>vim
354354
inoremap <C-e> <Cmd>call ddc#hide()<CR>
355355
<
356356
*ddc#on_complete_done()*
@@ -414,7 +414,7 @@ ddc#custom#alias({type}, {alias-name}, {base-name})
414414
Define {alias-name} alias based on {base-name}.
415415
{type} must be "source" or "filter".
416416
NOTE: It must be called before sources/filters initialization.
417-
>
417+
>vim
418418
call ddc#custom#alias('source', 'foo', 'around')
419419
call ddc#custom#patch_global('sources', ['foo'])
420420
call ddc#custom#patch_global('sourceOptions', #{
@@ -511,7 +511,7 @@ ddc#custom#set_context_filetype({filetype}, {func})
511511
dictionary.
512512
NOTE: {func} is evaluated after user input and it affects
513513
completion performance.
514-
>
514+
>vim
515515
call ddc#custom#set_context_filetype('go', { ->
516516
\ ddc#syntax#in('TSComment') ? {
517517
\ 'sources': ['nextword', 'around'],
@@ -596,7 +596,7 @@ NOTE: You can call events manually by |ddc#on_event()|.
596596

597597
==============================================================================
598598
EXAMPLES *ddc-examples*
599-
>
599+
>vim
600600
" Customize global settings
601601

602602
" You must set the default ui.
@@ -1333,15 +1333,15 @@ Q: I want to use inline suggestion like fish shell.
13331333
A: NOTE: "ddc-ui-inline" is required.
13341334

13351335
https://github.com/Shougo/ddc-ui-inline
1336-
>
1336+
>vim
13371337
inoremap <expr> <C-t> ddc#map#insert_item(0)
13381338
call ddc#custom#patch_global('ui', 'inline')
13391339
<
13401340
*ddc-faq-5*
13411341
Q: The Linked/chained completion exists like vim-mucomplete?
13421342

13431343
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
13451345

13461346
let g:chains = ['around', 'zsh', 'deoppet']
13471347
function MyChainCompletion() abort
@@ -1356,14 +1356,14 @@ Q: I want to silence the |ins-completion-menu| messages in the command line
13561356
such as "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern
13571357
not found", "Back at original", etc.
13581358

1359-
A: You can disable the messages through the 'shortmess' option. >
1359+
A: You can disable the messages through the 'shortmess' option. >vim
13601360

13611361
set shortmess+=c
13621362
<
13631363
*ddc-faq-7*
13641364
Q: I want to use the auto select feature.
13651365

1366-
A: You can use it by the 'completeopt' option. >
1366+
A: You can use it by the 'completeopt' option. >vim
13671367

13681368
set completeopt+=noinsert
13691369
<
@@ -1375,11 +1375,11 @@ A: Please press <C-y> on the item.
13751375
*ddc-faq-9*
13761376
Q: I want to close the preview window after completion is done.
13771377

1378-
A: >
1378+
A: >vim
13791379
autocmd CompleteDone * silent! pclose!
13801380
<
13811381
Or
1382-
>
1382+
>vim
13831383
autocmd InsertLeave * silent! pclose!
13841384
<
13851385
NOTE: It conflicts with delimitMate.
@@ -1388,7 +1388,7 @@ Or
13881388
*ddc-faq-10*
13891389
Q: I want to disable the preview window feature.
13901390

1391-
A: >
1391+
A: >vim
13921392
set completeopt-=preview
13931393
<
13941394
*ddc-faq-11*
@@ -1445,7 +1445,7 @@ https://github.com/LumaKernel/ddc-source-file
14451445
*ddc-faq-14*
14461446
Q: I want to enable "skkeleton" source when "skkeleton" is enabled only.
14471447

1448-
A: >
1448+
A: >vim
14491449
autocmd User skkeleton-enable-pre call s:skkeleton_pre()
14501450
function s:skkeleton_pre() abort
14511451
" Overwrite sources
@@ -1470,7 +1470,7 @@ https://github.com/Shougo/pum.vim
14701470
https://github.com/Shougo/ddc-ui-pum
14711471
https://github.com/Shougo/ddc-source-cmdline
14721472
https://github.com/Shougo/ddc-source-cmdline-history
1473-
>
1473+
>vim
14741474
call ddc#custom#patch_global(#{
14751475
\ ui: 'pum',
14761476
\ autoCompleteEvents: [
@@ -1514,7 +1514,7 @@ NOTE: Both "pum.vim" and "ddc-ui-pum" are required.
15141514
https://github.com/Shougo/pum.vim
15151515
https://github.com/Shougo/ddc-ui-pum
15161516
https://github.com/Shougo/ddc-source-input
1517-
>
1517+
>vim
15181518
call ddc#custom#patch_global(#{
15191519
\ ui: 'pum',
15201520
\ autoCompleteEvents: [
@@ -1536,7 +1536,7 @@ https://github.com/hrsh7th/nvim-cmp/issues/309#issuecomment-940740456
15361536
Q: I want to enable auto completion in fine-cmdline.nvim
15371537
https://github.com/VonHeikemen/fine-cmdline.nvim
15381538

1539-
A: NOTE: Experimental >
1539+
A: NOTE: Experimental >vim
15401540

15411541
lua <<EOF
15421542
require('fine-cmdline').setup({
@@ -1583,15 +1583,15 @@ Q: I want to disable ddc auto completion.
15831583
A: You need to set ui manually.
15841584
https://github.com/Shougo/ddc-ui-none
15851585
https://github.com/Shougo/ddc-ui-native
1586-
>
1586+
>vim
15871587
call ddc#custom#patch_global('ui', 'none')
15881588
inoremap <expr> <TAB> ddc#map#complete('native')
15891589

15901590
If you want to use "pum.vim".
15911591
https://github.com/Shougo/ddc-ui-none
15921592
https://github.com/Shougo/ddc-ui-pum
15931593
https://github.com/Shougo/pum.vim
1594-
>
1594+
>vim
15951595
call ddc#custom#patch_global('ui', 'none')
15961596
inoremap <expr> <TAB> ddc#map#complete('pum')
15971597
call ddc#custom#patch_global('uiParams', #{
@@ -1625,7 +1625,7 @@ If you really want to need the completion, please enable
16251625
*ddc-faq-23*
16261626
Q: "copilot.vim" does not work when ddc.vim popup is visible.
16271627

1628-
A: "copilot.vim" checks |pumvisible()|. You should disable it. >
1628+
A: "copilot.vim" checks |pumvisible()|. You should disable it. >vim
16291629

16301630
let g:copilot_hide_during_completion = 0
16311631
<
@@ -1639,7 +1639,7 @@ You need to enable |ddc-option-specialBufferCompletion| for it.
16391639
Q: I want to narrow current items without auto completion.
16401640

16411641
A: You can narrow current items by "ddu.vim" like this.
1642-
>
1642+
>vim
16431643
inoremap <C-l> <Cmd>call ddu#start(#{
16441644
\ name: 'ddc',
16451645
\ ui: 'ff',
@@ -1670,7 +1670,7 @@ NOTE: Use "deol.nvim" and "ddc-source-zsh" is recommend.
16701670
https://github.com/Shougo/deol.nvim
16711671
https://github.com/Shougo/ddc-source-zsh
16721672

1673-
>
1673+
>vim
16741674
call ddc#custom#patch_global('autoCompleteEvents', [
16751675
\ 'InsertEnter', 'TextChangedI', 'TextChangedP',
16761676
\ 'CmdlineEnter', 'CmdlineChanged', 'TextChangedT',
@@ -1707,7 +1707,7 @@ Q: The |:normal| command is slow from command line.
17071707

17081708
A: Many |InsertEnter|, |InsertLeave| and |ModeChanged| autocmds are fired.
17091709
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
17111711
:noautocmd %normal Itest
17121712
<
17131713
*ddc-faq-29*
@@ -1723,13 +1723,15 @@ https://github.com/Milly/ddc-unprintable
17231723
*ddc-faq-30*
17241724
Q: I want to use "inline" UI when there's single item.
17251725

1726-
A: You can use |ddc-option-dynamicUi| for it. >
1726+
A: You can use |ddc-option-dynamicUi| for it. >vim
17271727
args.contextBuilder.patchGlobal({
17281728
dynamicUi: (_denops: Denops, args: Record<string, unknown>) => {
17291729
const uiArgs = args as {
17301730
items: DdcItem[],
17311731
};
1732-
return Promise.resolve(uiArgs.items.length == 1 ? "inline" : "pum");
1732+
return Promise.resolve(
1733+
uiArgs.items.length == 1 ? "inline" : "pum"
1734+
);
17331735
},
17341736
});
17351737
<

0 commit comments

Comments
 (0)