-
-
Notifications
You must be signed in to change notification settings - Fork 295
/
deoplete.txt
2149 lines (1651 loc) · 64.2 KB
/
deoplete.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*deoplete.txt* Dark powered asynchronous completion framework for Neovim/Vim8
Version: 6.2
Author: Shougo <Shougo.Matsu at gmail.com>
License: MIT license
CONTENTS *deoplete-contents*
Introduction |deoplete-introduction|
Install |deoplete-install|
Interface |deoplete-interface|
Options |deoplete-options|
Variables |deoplete-variables|
Key mappings |deoplete-key-mappings|
Functions |deoplete-functions|
Custom Functions |deoplete-custom-functions|
Examples |deoplete-examples|
Sources |deoplete-sources|
Create source |deoplete-create-source|
Source attributes |deoplete-source-attributes|
Candidate attributes |deoplete-candidate-attributes|
Create filter |deoplete-create-filter|
FILTERS |deoplete-filters|
External sources |deoplete-external-sources|
External plugins |deoplete-external-plugins|
FAQ |deoplete-faq|
Compatibility |deoplete-compatibility|
==============================================================================
INTRODUCTION *deoplete-introduction*
*deoplete* is the abbreviation of "dark powered neo-completion". It
provides an asynchronous keyword completion system in the
current buffer.
Note: deoplete may consume more memory than other plugins do.
Improvements in deoplete in comparison to neocomplete:
1. Real asynchronous completion behavior like YouCompleteMe by default.
2. Uses Python3 to implement sources.
3. Removes legacy interface.
4. Requires |+python3|.
==============================================================================
INSTALL *deoplete-install*
Note: deoplete requires Neovim (0.3.0+) or Vim8.2.1978+ (latest is
recommended) with Python 3.6.1+ and |+timers| enabled.
Please install/upgrade msgpack package (1.0.0+).
https://github.com/msgpack/msgpack-python
Please install nvim-yarp plugin for Vim8.
https://github.com/roxma/nvim-yarp
Please install vim-hug-neovim-rpc plugin for Vim8.
https://github.com/roxma/vim-hug-neovim-rpc
1. Extract the files and put them in your Neovim or .vim directory
(usually `$XDG_CONFIG_HOME/nvim/`).
2. Call |deoplete#enable()| or set "let g:deoplete#enable_at_startup = 1" in
your `init.vim`/`vimrc`
3. Execute the ":UpdateRemotePlugins" if Neovim.
If ":echo has('python3')" returns `1`, then you're done; otherwise, see below.
You can enable Python3 interface with pip: >
pip3 install --user pynvim
Note: deoplete needs pynvim ver.0.3.0+.
You need update pynvim module.
>
pip3 install --user --upgrade pynvim
<
If you want to read for Neovim-python/python3 interface install documentation,
you should read |provider-python|.
You can check the Python3 installation by using the |:checkhealth| command.
==============================================================================
INTERFACE *deoplete-interface*
------------------------------------------------------------------------------
OPTIONS *deoplete-options*
Options can be toggled through the use of |deoplete#custom#option()|.
For example:
>
" Set a single option
call deoplete#custom#option('auto_complete_delay', 200)
" Pass a dictionary to set multiple options
call deoplete#custom#option({
\ 'auto_complete_delay': 200,
\ 'smart_case': v:true,
\ })
<
The set of available options follows.
*deoplete-options-auto_complete*
auto_complete
If it is False, automatic completion becomes invalid, but can
use the manual completion by |deoplete#manual_complete()|.
Default value: v:true
*deoplete-options-auto_complete_delay*
auto_complete_delay
Delay the completion after input in milliseconds.
Default value: 20 (milliseconds)
*deoplete-options-auto_complete_popup*
auto_complete_popup
Change auto completion popup behavior.
"auto": popup is displayed automatically.
"manual": popup is displayed by |deoplete#complete()|.
Default value: "auto"
*deoplete-options-auto_refresh_delay*
auto_refresh_delay
Delay the refresh when asynchronous.
If it is less than equal 0, the feature is disabled.
Default value: 100 (milliseconds)
*deoplete-options-candidate_marks*
candidate_marks
The candidate additional marks.
If set, this will be used to display an additional mark next
to the the first {N} candidates. The first mark is used for
the top ranked candidate, the second for the second candidate
and so forth.
In the example below, the first 5 candidates are marked A..G,
which serve as mnemonics for commands to insert that
candidate.
Default value: []
>
call deoplete#custom#option('candidate_marks',
\ ['A', 'S', 'D', 'F', 'G'])
inoremap <expr>A pumvisible() ?
\ deoplete#insert_candidate(0) : 'A'
inoremap <expr>S pumvisible() ?
\ deoplete#insert_candidate(1) : 'S'
inoremap <expr>D pumvisible() ?
\ deoplete#insert_candidate(2) : 'D'
inoremap <expr>F pumvisible() ?
\ deoplete#insert_candidate(3) : 'F'
inoremap <expr>G pumvisible() ?
\ deoplete#insert_candidate(4) : 'G'
<
*deoplete-options-check_stderr*
check_stderr
If it is True, deoplete check stderr output.
Default value: v:true
*deoplete-options-complete_suffix*
complete_suffix
If it is True, deoplete inserts the suffix of the completion
for supported sources. It is useful for deoplete-tabnine.
Default value: v:true
*deoplete-options-ignore_sources*
ignore_sources
It is a dictionary to decide ignore source names.
The key is filetype and the value is source names list.
Note: It is disabled in |deoplete#manual_complete()|.
Default value: {}
*deoplete-options-keyword_patterns*
keyword_patterns
It defines the keyword patterns for completion.
This is appointed in regular expression string or list every
file type.
Note: It is Python3 regexp. But "\k" is converted to
'iskeyword' pattern.
>
call deoplete#custom#option('keyword_patterns', {
\ '_': '[a-zA-Z_]\k*',
\ 'tex': '\\?[a-zA-Z_]\w*',
\ 'ruby': '[a-zA-Z_]\w*[!?]?',
\})
<
Default value: {}
*deoplete-options-max_list*
max_list
Show up to this limit candidates.
Default value: 500
*deoplete-options-nofile_complete_filetypes*
nofile_complete_filetypes
If 'buftype' is "nofile", deoplete completion is disabled
automatically except the filetype list.
Default value: ["denite-filter"]
*deoplete-options-num_processes*
num_processes
The number of processes used for the deoplete parallel
completion feature.
The parallel completion increases the completion speed, but it
increases the screen flicker.
If it is 1, this feature is disabled.
If it is less than or equal to 0, the number of processes is
equal to that of sources.
Default value: 1
*deoplete-options-omni_patterns*
omni_patterns
If omni_patterns is set, deoplete will call 'omnifunc'
directly as soon as a pattern is matched.
Note: This will disable deoplete filtering and combination of
sources for those matches. Suggested use is only for legacy
omnifunc plugins which do not return all results when provided
an empty base argument or moves the cursor in omnifunc. See
|complete-functions|
Note: You need to set "noselect" in 'completeopt' option to
work.
If this pattern is not defined or empty for a filetype,
deoplete does not call 'omnifunc'.
Note: It is a Vim regexp.
>
set completeopt+=noselect
call deoplete#custom#option('omni_patterns', {
\ 'ruby': ['[^. *\t]\.\w*', '[a-zA-Z_]\w*::'],
\ 'java': '[^. *\t]\.\w*',
\ 'html': ['<', '</', '<[^>]*\s[[:alnum:]-]*'],
\ 'xhtml': ['<', '</', '<[^>]*\s[[:alnum:]-]*'],
\ 'xml': ['<', '</', '<[^>]*\s[[:alnum:]-]*'],
\})
<
Default value: {}
*deoplete-options-on_insert_enter*
on_insert_enter
Deoplete enables the auto completion on |InsertEnter| autocmd
if this value is True.
Default value: v:true
*deoplete-options-on_text_changed_i*
on_text_changed_i
Deoplete enables the auto completion on |TextChangedI| autocmd
if this value is True.
Default value: v:true
*deoplete-options-overwrite_completeopt*
overwrite_completeopt
Deoplete overwrites 'completeopt' option.
You can disable the feature but if you change it, deoplete may
not work.
Default value: v:true
*deoplete-options-profile*
profile
If it is True, deoplete will print the time information to
|deoplete#enable_logging()| logfile.
Must be set in init.vim/vimrc before starting Neovim/Vim.
Does not support command line.
Default value: v:false
*deoplete-options-prev_completion_mode*
prev_completion_mode
It changes previous completion behavior.
It reduces popup flicker.
"filter": Filter previous completion
"length": Filter previous completion like
|deoplete-filter-matcher_length|.
"mirror": Displays previous completion. It is useful for
deoplete-tabnine.
otherwise: Disable previous completion feature.
Default value: "filter"
*deoplete-options-refresh_always*
refresh_always
Deoplete refreshes the candidates automatically if this value
is True.
Note: It increases the screen flicker when
|deoplete-options-num_processes| != 0.
Default value: v:true
*deoplete-options-refresh_backspace*
refresh_backspace
Deoplete refreshes the candidates automatically when you
press <BS> or <C-h> key.
Default value: v:true
*deoplete-options-skip_multibyte*
skip_multibyte
Deoplete skips multibyte text completion automatically if this
value is True.
Default value: v:false
*deoplete-options-skip_chars*
skip_chars
The list of skip characters in the auto completion.
Default value: ['(', ')']
*deoplete-options-sources*
sources
It is a dictionary to specify source names. The key is
filetype and the value is a list of source names. If the key
is "_", the value will be used for default filetypes. For
example, you can load some sources in C++ filetype. If the
value is [], it will load all sources.
Default value: {}
>
" Example:
call deoplete#custom#option('sources', {
\ '_': ['buffer'],
\ 'cpp': ['buffer', 'tag'],
\})
<
*deoplete-options-min_pattern_length*
min_pattern_length
The default number of the input completion at the time of key
input automatically.
Note: You should change
|deoplete-source-attribute-min_pattern_length|.
Default: 2
*deoplete-options-yarp*
yarp
Use nvim-yarp library instead of neovim remote plugin feature.
Note: nvim-yarp plugin is needed.
https://github.com/roxma/nvim-yarp
Default value: v:false
------------------------------------------------------------------------------
VARIABLES *deoplete-variables*
*g:deoplete#enable_at_startup*
g:deoplete#enable_at_startup
Deoplete gets started automatically when Neovim/Vim starts if
this value is 1.
Default: 0
Note: It means you cannot use deoplete unless you start it
manually.
------------------------------------------------------------------------------
FUNCTIONS *deoplete-functions*
*deoplete#disable()*
deoplete#disable()
Disable deoplete auto completion.
Note: It changes the global state.
*deoplete#enable()*
deoplete#enable()
Enable deoplete auto completion.
Note: It changes the global state.
Note: It does not work in lazy loading. You should use
|g:deoplete#enable_at_startup| instead.
*deoplete#enable_logging()*
deoplete#enable_logging({level}, {logfile})
Enable logging for debugging purposes.
Set {level} to "DEBUG", "INFO", "WARNING", "ERROR", or
"CRITICAL".
{logfile} is the file where log messages are written.
Messages are appended to this file. Each log session will
start with "--- Deoplete Log Start ---".
Note: You must enable
|deoplete-source-attribute-is_debug_enabled| to debug the
sources.
*deoplete#initialize()*
deoplete#initialize()
Initialize deoplete and sources.
Note: You should call it in |VimEnter| autocmd.
User customization for deoplete must be set before
initialization of deoplete.
*deoplete#send_event()*
deoplete#send_event({event}, [{sources}])
Call |deoplete-source-attribute-on_event| manually.
{event} is event name. {sources} are sources list.
*deoplete#toggle()*
deoplete#toggle()
Toggle deoplete auto completion.
Note: It changes the global state.
CUSTOM FUNCTIONS *deoplete-custom-functions*
*deoplete#custom#buffer_filter()*
deoplete#custom#buffer_filter({option-name}, {value})
deoplete#custom#buffer_filter({dict})
The buffer local version of |deoplete#custom#filter()|.
*deoplete#custom#buffer_option()*
deoplete#custom#buffer_option({option-name}, {value})
deoplete#custom#buffer_option({dict})
The buffer local version of |deoplete#custom#option()|.
*deoplete#custom#buffer_var()*
deoplete#custom#buffer_var({source-name}, {var-name}, {value})
deoplete#custom#buffer_var({source-name}, {dict})
The buffer local version of |deoplete#custom#var()|.
*deoplete#custom#filter()*
deoplete#custom#filter({filter-name}, {var-name}, {value})
deoplete#custom#filter({filter-name}, {dict})
Set {filter-name} source specialized variable {variable-name}
to {value}. You may specify multiple sources with the
separator "," in {filter-name}.
If {dict} is available, the key is {option-name} and the value
is {value}.
*deoplete#custom#option()*
deoplete#custom#option({option-name}, {value})
deoplete#custom#option({dict})
Set {option-name} option to {value}.
If {dict} is available, the key is {option-name} and the value
is {value}.
*deoplete#custom#source()*
deoplete#custom#source({source-name}, {option-name}, {value})
deoplete#custom#source({source-name}, {dict})
Set {source-name} source specialized {option-name}
to {value}. You may specify multiple sources with
separating "," in {source-name}.
If {source-name} is "_", sources default option will be
change.
If {dict} is available, the key is {option-name} and the value
is {value}.
Note: You must call it before using deoplete.
>
" Examples:
" Use head matcher instead of fuzzy matcher
call deoplete#custom#source('_',
\ 'matchers', ['matcher_head'])
" Use auto delimiter feature
call deoplete#custom#source('_', 'converters',
\ ['converter_auto_delimiter', 'remove_overlap'])
call deoplete#custom#source('buffer',
\ 'min_pattern_length', 9999)
" Change the source rank
call deoplete#custom#source('buffer', 'rank', 9999)
" Enable buffer source in C/C++ files only.
call deoplete#custom#source('buffer',
\ 'filetypes', ['c', 'cpp'])
" Disable the candidates in Comment/String syntaxes.
call deoplete#custom#source('_',
\ 'disabled_syntaxes', ['Comment', 'String', 'Constant'])
" Change the truncate width.
call deoplete#custom#source('javacomplete2',
\ 'max_abbr_width', 20)
call deoplete#custom#source('javacomplete2',
\ 'max_menu_width', 80)
" Disable the truncate feature.
call deoplete#custom#source('javacomplete2',
\ 'max_abbr_width', 0)
call deoplete#custom#source('javacomplete2',
\ 'max_menu_width', 0)
" Change the source mark.
call deoplete#custom#source('buffer', 'mark', '*')
" Disable the source mark.
call deoplete#custom#source('omni', 'mark', '')
" Enable jedi source debug messages
" call deoplete#custom#option('profile', v:true)
" call deoplete#enable_logging('DEBUG', 'deoplete.log')
" call deoplete#custom#source('jedi',
\ 'is_debug_enabled', v:true)
<
*deoplete#custom#var()*
deoplete#custom#var({source-name}, {var-name}, {value})
deoplete#custom#var({source-name}, {dict})
Set {source-name} source specialized variable {variable-name}
to {value}. You may specify multiple sources with the
separator "," in {source-name}.
If {dict} is available, the key is {option-name} and the value
is {value}.
------------------------------------------------------------------------------
KEY MAPPINGS *deoplete-key-mappings*
*deoplete#auto_complete()*
deoplete#auto_complete([{event}])
It calls the auto completion of deoplete. You can use it to
call auto completion again.
{event} is autocmd event name. If it is omitted, "Async" is
used.
*deoplete#can_complete()*
deoplete#can_complete()
Return v:true if current word completion is available.
Note: |deoplete-options-auto_complete_popup| must be "manual".
*deoplete#close_popup()*
deoplete#close_popup()
Insert candidate and close popup menu for deoplete.
Note: It must be in |:map-<expr>|.
*deoplete#complete()*
deoplete#complete()
Open current completion popup menu.
Note: It must be in |:map-<expr>|.
*deoplete#complete_common_string()*
deoplete#complete_common_string()
complete common string in candidates.
This can be useful when candidates have a long common prefix.
Note: It must be in |:map-<expr>|.
*deoplete#insert_candidate()*
deoplete#insert_candidate({index})
Insert the candidate at index {index}. Indices start at 0.
Note: It must be in |:map-<expr>|.
*deoplete#manual_complete()*
deoplete#manual_complete([{sources}])
Trigger deoplete completion. You can use it with
custom completion setups.
You can provide a list of {sources}: It can be the name of a
source or a list of sources name.
Note: It blocks your Neovim/Vim.
Note: It must be in |:map-<expr>|.
If you want to trigger deoplete manually, see also
|deoplete-options-auto_complete|, which should typically then
be 1.
>
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#manual_complete()
function! s:check_back_space() abort "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
<
*deoplete#smart_close_popup()*
deoplete#smart_close_popup()
Insert candidate and re-generate popup menu for deoplete.
Note: It must be in |:map-<expr>|.
>
inoremap <expr><C-h>
\ deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS>
\ deoplete#smart_close_popup()."\<C-h>"
<
Note: This mapping conflicts with SuperTab or endwise plugins.
Note: This key mapping is for <C-h> or <BS> keymappings.
*deoplete#undo_completion()*
deoplete#undo_completion()
Undo inserted candidate.
Note: It must be in |:map-<expr>|.
>
inoremap <expr><C-g> deoplete#undo_completion()
<
==============================================================================
EXAMPLES *deoplete-examples*
>
" Use deoplete.
let g:deoplete#enable_at_startup = 1
" Use smartcase.
call deoplete#custom#source('_', 'smart_case', v:true)
" <CR>: close popup and save indent.
inoremap <silent> <CR> <Cmd>call <SID>my_cr_function()<CR>
function! s:my_cr_function() abort
return deoplete#close_popup() . "\<CR>"
endfunction
<
==============================================================================
SOURCES *deoplete-sources*
around *deoplete-source-around*
This source collects candidates around the cursor, namely
inside current buffer. Plus, it searches keywords in
|:changes| command output. Therefore, this source provides
the words that are in sight or the ones you've just typed
somewhere else.
By default, around has a fixed range of looking for words
20 lines above and below your cursor position. You are able
to customize its settings through custom source variables.
Note: There are no events for changing this. Configuration
should be done before the source initializes.
>
" Using custom variables to configure values
" - range_above = Search for words N lines above.
" - range_below = Search for words N lines below.
" - mark_above = Mark shown for words N lines above.
" - mark_below = Mark shown for words N lines below.
" - mark_changes = Mark shown for words in the changelist.
call deoplete#custom#var('around', {
\ 'range_above': 15,
\ 'range_below': 15,
\ 'mark_above': '[↑]',
\ 'mark_below': '[↓]',
\ 'mark_changes': '[*]',
\})
<
rank: 300
buffer *deoplete-source-buffer*
This source collects keywords from current buffer and the
current tabpage windows buffers and the opened buffers which
have same 'filetype'.
Note: It does not collect keywords from not loaded buffer.
For example, if you open file by "nvim A B". A is already
loaded, but B is not loaded. So buffer source cannot collect
the keywords in B until you switch to buffer B.
Note: It takes time to get the candidates in the first time if
you want to edit the large files (like Vim 22000 lines
eval.c).
rank: 100
Source custom variables:
require_same_filetype
If it is False, deoplete collects keywords
from buffers of any filetype
(default: v:true)
file *deoplete-source-file*
This source collects keywords from local files. Specifically,
it completes file and directory names and paths, e.g.
/usr/lib/share.
rank: 150
Source custom variables:
enable_buffer_path
If it is True, file source completes the files
from the buffer directory instead of the
current directory.
(default: v:true)
enable_slash_completion
If it is True, file source completes the files
when user input "/".
(default: v:false)
force_completion_length
The completion length if the input does not
contain "/".
If it is less than 0, it is disabled.
(default: -1)
member *deoplete-source-member*
This source collects members from current buffer.
rank: 100
Source custom variables:
prefix_patterns
This dictionary records prefix patterns to
member completion. This is appointed in
regular expression string or list every file
type. If this pattern is not defined or
empty, deoplete does not complete member
candidates.
Note: It is Python3 regexp.
(default: See in member.py)
omni *deoplete-source-omni*
This source collects keywords from 'omnifunc'.
Note: It is not asynchronous.
rank: 500
Source custom variables:
functions
It defines a dictionary for omni completion
with deoplete:
- `keys` consist of filetypes;
- `values` consist of either a string
containing a single omnifunc or a list with
omnifuncs to be used for each filetype.
In case there is no omnifunc setting for the
current filetype in the dictionary, deoplete
will use the 'omnifunc' setting.
Note: It supports context filetype feature
instead of 'omnifunc'. You can call the
omnifunc in the embedded language.
Note: For omnifunctions to work with deoplete,
it's necessary to setup the "input_patterns"
setting.
(default: {})
>
call deoplete#custom#var('omni', 'functions', {
\ 'javascript': ['tern#Complete', 'jspc#omni']
\})
<
input_patterns
This dictionary records keyword patterns to
Omni completion. This is appointed in regular
expression string or list every file type. If
this pattern is not defined or empty, deoplete
does not call 'omnifunc'.
Note: Some omnifuncs which moves the cursor is
not worked. For example, htmlcomplete,
phpcomplete, etc...
Note: It is Python3 regexp.
(default: See in omni.py)
>
call deoplete#custom#var('omni', 'input_patterns', {
\ 'java': '[^. *\t]\.\w*',
\ 'php': '\w+|[^. \t]->\w*|\w+::\w*',
\})
<
==============================================================================
FILTERS *deoplete-filters*
Once candidates have been supplied by one or more sources, they are passed
through the filters, which are matchers, converters or sorters. Sources can
have specific filters.
*deoplete-filter-matcher_default*
Default matchers: ['matcher_fuzzy']
You can change it by |deoplete#custom#source()|.
*deoplete-filter-sorter_default*
Default sorters: ['sorter_rank'].
You can change it by |deoplete#custom#source()|.
*deoplete-filter-converter_default*
Default converters: ['converter_remove_overlap', 'converter_truncate_abbr',
'converter_truncate_kind', 'converter_truncate_info',
'converter_truncate_menu'].
You can change it by |deoplete#custom#source()|.
*deoplete-filter-matcher_cpsm*
matcher_cpsm
A matcher which filters the candidates using cpsm.
It is like |deoplete-filter-matcher_full_fuzzy| but faster.
It also sorts the candidates using cpsm.
Note: cpsm plugin build/install is needed in 'runtimepath'.
https://github.com/nixprime/cpsm
Note: You must use Python3 support enabled cpsm. >
$ PY3=ON ./install.sh
<
Configuration example: >
>
call deoplete#custom#source('_', 'matchers', ['matcher_cpsm'])
call deoplete#custom#source('_', 'sorters', [])
<
*deoplete-filter-matcher_full_fuzzy*
matcher_full_fuzzy
Full fuzzy matching matcher.
It accepts partial fuzzy matches like YouCompleteMe.
*deoplete-filter-matcher_fuzzy*
matcher_fuzzy Fuzzy matching matcher.
*deoplete-filter-matcher_head*
matcher_head Head matching matcher.
*deoplete-filter-matcher_length*
matcher_length
Length matching matcher.
It removes candidates shorter than or equal to the user input.
*deoplete-filter-matcher_matchfuzzy*
matcher_matchfuzzy
|matchfuzzy()| matcher.
*deoplete-filter-sorter_rank*
sorter_rank Matched rank order sorter. The higher the head matched word
or already typed or inserted word.
The locality bonus feature is implemented like VSCode.
*deoplete-filter-sorter_word*
sorter_word Word order sorter.
*deoplete-filter-converter_auto_delimiter*
converter_auto_delimiter
It adds "delimiters" variable characters in a candidate's
word if the candidate's abbr contains the delimiters.
Filter custom variables:
delimiters
Delimiters list.
(default: ['/'])
*deoplete-filter-converter_reorder_attr*
converter_reorder_attr
Reorder candidates by their attributes in the order specified.
See `:help complete-items` for the structure of candidate
objects.
For instance, you can choose which types of candidates appear
first in the suggestion according to their attributes.
>
call deoplete#custom#filter('converter_reorder_attr',
\ 'attrs_order', {
\ 'javascript': {
\ 'kind': [
\ 'Function',
\ 'Property'
\ ]
\ },
\})
<
This says: For Javascript files, I want to reorder candidates:
1. Candidates which have a "kind" attribute containing
'Function' should appear first.
2. Candidates which have a "kind" attribute containing
'Property' should appear second.
3. Any other candidates appear at the bottom, if there is
space.
Complete menu - before:
__constructor__ [Constructor]
length [Property]
from [Function]
toString [Function]
Complete menu - after:
from [Function]
toString [Function]
length [Property]
__constructor__ [Constructor]
Note: Attribute values are compiled to python regex
expressions, so you can match 'Function' with "Func" or
'static void* callback(unsigned *int number)' with "call".
You can specify multiple attributes and they will be processed
in order.
Additionally, you can filter out unwanted candidates by
prefixing an attribute value with '!'. This character is only
a flag and will be stripped out before compiling the
expression.
>
call deoplete#custom#filter('converter_reorder_attr',
\ 'attrs_order', {
\ 'ruby': {
\ 'kind': [
\ '!Class',
\ ],
\ 'abbr': [
\ 'ExtensionClass'
\ ]
\ },
\})
<
The example above says: For Ruby files, I want to reorder the
candidates:
1. Candidates which have a "kind" attribute containing 'Class'
will be filtered out of the list.
After they have been removed, proceed to the next attribute.
2. Candidates which have a "abbr" attribute containing
'ExtensionClass' will be moved to the top of the list.
3. Any other candidates appear at the bottom, if there is
space.
Filter custom variables:
attrs_order
It should received a dictionary with mappings
from filetypes to attributes, following the
attribute expression syntax explained above.
(default: {})
*deoplete-filter-converter_auto_paren*
converter_auto_paren
It adds parentheses character in a candidate's word.
It is useful if you use neopairs or neosnippet plugins.
*deoplete-filter-converter_case*
converter_case
It converts case like 'infercase'.
*deoplete-filter-converter_remove_overlap*
converter_remove_overlap
It removes overlapped text in a candidate's word.
*deoplete-filter-converter_remove_paren*
converter_remove_paren
It removes parentheses character in a candidate's word.
*deoplete-filter-converter_truncate_abbr*
converter_truncate_abbr
It truncates a candidate's abbr by the current window width.
*deoplete-filter-converter_truncate_kind*
converter_truncate_kind
It truncates a candidate's kind by the current window width.
*deoplete-filter-converter_truncate_info*
converter_truncate_info
It truncates a candidate's info by the current window width.
*deoplete-filter-converter_truncate_menu*
converter_truncate_menu
It truncates a candidate's menu by the current window width.
*deoplete-filter-converter_word_abbr*
converter_word_abbr
Convert candidate word to abbr.
CREATE SOURCE *deoplete-create-source*
To create source, you should read default sources implementation in
rplugin/python3/deoplete/source/*.py.
The files are automatically loaded and deoplete creates new Source class
object.
Source class must extend the Base class in ".base".
Note: The sources must be written in Python3 language.
Note: If you call Vim functions in your source, it is not asynchronous.
------------------------------------------------------------------------------
SOURCE ATTRIBUTES *deoplete-source-attributes*
*deoplete-source-attribute-__init__*
__init__ (Function)
Source constructor. It is always called in initializing. It
must call super() constructor. This function takes {self} and
{vim} as its parameters.
*deoplete-source-attribute-__*
__{name} (Unspecified) (Optional)
Additional source information.
Note: Sources should save variables instead of
global variables.
*deoplete-source-attribute-camel_case*
camel_case
If it is True, lowercase letters are also matched with the
corresponding uppercase ones.
Ex: "foB" is matched with "FooBar" but not with "foobar".
Note: This feature is only available in
|deoplete-filter-matcher_fuzzy| or
|deoplete-filter-matcher_full_fuzzy|.
Default value: v:false
*deoplete-source-attribute-converters*
converters (List[str]) (Optional)
Source default converters list.