-
Notifications
You must be signed in to change notification settings - Fork 202
/
neocomplete.txt
1881 lines (1525 loc) · 63.1 KB
/
neocomplete.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
*neocomplete.txt* Next generation of auto completion framework.
Version: 2.2
Author: Shougo <Shougo.Matsu@gmail.com>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
CONTENTS *neocomplete-contents*
Introduction |neocomplete-introduction|
Install |neocomplete-install|
Interface |neocomplete-interface|
Commands |neocomplete-commands|
Variables |neocomplete-variables|
Sources variables |neocomplete-sources-variables|
Key mappings |neocomplete-key-mappings|
Functions |neocomplete-functions|
Examples |neocomplete-examples|
Sources |neocomplete-sources|
User sources |neocomplete-user-sources|
Create source |neocomplete-create-source|
Source attributes |neocomplete-source-attributes|
Candidate attributes |neocomplete-candidate-attributes|
Create filter |neocomplete-create-filter|
Filter attributes |neocomplete-filter-attributes|
FILTERS |neocomplete-filters|
External sources |neocomplete-external-sources|
FAQ |neocomplete-faq|
==============================================================================
INTRODUCTION *neocomplete-introduction*
*neocomplete* is the next generation auto completion framework and a superior
successor of the |neocomplcache| plugin. It provides a keyword completion
system by maintaining a keyword cache of the current buffer. The neocomplete
framework can be customized easily and has a lot more features than Vim's
standard completion.
Note: neocomplete may consume more memory than other plugins do.
Improvements in neocomplete in comparison to |neocomplcache|:
1. Real fuzzy match behavior like |YouCompleteMe| by default.
2. Refactored source interface.
3. Removed legacy interface.
4. Requires |if_lua|.
5. Optimized completion speed.
6. Changed source names.
7. Changed variable names.
8. Added new features.
==============================================================================
INSTALL *neocomplete-install*
Install prerequisites
In order to use neocomplete, the following prerequisites have to be met:
1. Vim build with the |if_lua| feature
2. Vim version 7.3.885 or above
The following sections describe where to get a Vim version, neocomplete
works with, for your operating system.
On Windows:
For 32bit http://files.kaoriya.net/goto/vim73w32
For 32bit (alternative) http://tuxproject.de/projects/vim/
http://wyw.dcweb.cn/#download
For 64bit http://files.kaoriya.net/goto/vim73w64
On Mac:
You can get |if_lua| enabled MacVim versions here:
https://github.com/zhaocai/macvim
http://code.google.com/p/macvim-kaoriya/
Or install it with homebrew:
>
brew install macvim --with-cscope --with-lua --HEAD
<
On Linux:
As almost all Vim packages offered by distributions are too old, you should
build Vim manually using gnu make and enable |if_lua| in the configuration
step. The following steps show you the general process on how to build Vim:
1. Get the source package
2. Unpack the sources
3. Configure the package (./configure). This step is essential to enable
the Vim features you like to use.
4. Build the package with gnu make
5. Install the package using your distributions package manager
You can find detailed information on ho to configure and build Vim from source
under following link: http://vim.wikia.com/wiki/Building_Vim. Or follow the
guide on:
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
Install the plugin
After you have installed the right version of Vim, you can go on to install
the neocomplete plugin. You can do this in a more old fashioned, manual way
or use a plugin manager like pathogen, vundle, neobundle. The second approach
is the recommended installation method.
Manual:
1. Get the plugin package
2. Extract the files and put them in your Vim directory
(usually ~/.vim/ or Program Files/Vim/vimfiles on Windows).
3. Execute |:NeoCompleteEnable| command or set following variable in your vimrc >
let g:neocomplete#enable_at_startup = 1
Package manager:
For instructions on how to set up a Vim package manager see the documentation
of the package manager of your choice. For example after the set up of
neobundle you can install the neocomplete plugin by following steps:
1. Let the plugin manger know about the package (.vimrc) >
NeoBundle 'Shougo/neocomplete.vim'
<
2. Install the plugin with the install command >
:NeoBundleInstall
<
*neocomplete-migration*
In case you are planing to move from neocomplcache to neocomplete there is a
wiki page that offers a migration guide.
https://github.com/Shougo/neocomplete.vim/wiki/neocomplete-migration-guide
*neocomplete-RECOMMENDATION*
*neocomplete-asynchronous*
If you have installed the |vimproc| plugin, neocomplete creates the caches
asynchronously. You can find vimproc at: http://github.com/Shougo/vimproc.
The vimproc plugin needs compilation before you can use it. You can find
further information in the vimproc documentation.
*neocomplete-snippets*
If you like to use the snippet feature with neocomplete, you need to install
the neosnippet plugin (https://github.com/Shougo/neosnippet.vim) or UltiSnips
(https://github.com/SirVer/ultisnips).
*neocomplete-context-filetype*
If you like to use the context filetype feature, you need to install the
context_filetype.vim plugin which you can find under the following repository:
https://github.com/Shougo/context_filetype.vim
*neocomplete-include*
If you want to complete the candidates from include files or include files
candidates, you need to install the neoinclude plugin
(https://github.com/Shougo/neoinclude.vim).
*neocomplete-syntax*
If you want to complete the candidates from syntax files, you need to install
the neco-syntax plugin (https://github.com/Shougo/neco-syntax).
==============================================================================
INTERFACE *neocomplete-interface*
------------------------------------------------------------------------------
COMMANDS *neocomplete-commands*
:NeoCompleteEnable *:NeoCompleteEnable*
Validate neocomplete and initialize it.
Warning: Existing cache disappears.
:NeoCompleteDisable *:NeoCompleteDisable*
Invalidate neocomplete and clean it up.
:NeoCompleteToggle *:NeoCompleteToggle*
Change the lock/unlock state of neocomplete.
While neocomplete is in locking, you cannot use automatic
completions.
Note: This command also enables neocomplete if it is disabled.
:NeoCompleteLock *:NeoCompleteLock*
Lock neocomplete.
While neocomplete is in locking, you cannot use automatic
completions but can use manual completions.
The lock status is local to each buffer.
Note: This command is disabled when neocomplete is disabled.
:NeoCompleteUnlock *:NeoCompleteUnlock*
Unlock neocomplete.
Note: This command is disabled when neocomplete is disabled.
*:NeoCompleteAutoCompletionLength*
:NeoCompleteAutoCompletionLength {length}
Change the length of chars to start automatic completion to
{length}.
Note: The length value is local to each buffer.
:NeoCompleteClean *:NeoCompleteClean*
Clean files in |g:neocomplete#data_directory|.
:NeoCompleteSetFileType [filetype] *:NeoCompleteSetFileType*
Change the filetype to [filetype] in the current buffer.
This filetype is only used by neocomplete, so syntax
highlighting and etc stay same.
Note: You can get the current filetype by
|neocomplete#get_context_filetype()|
SOURCES COMMANDS *neocomplete-sources-COMMANDS*
:NeoCompleteBufferMakeCache [bufname] *:NeoCompleteBufferMakeCache*
Make a cache based on the buffer with the name [bufname].
The command selects the current buffer when you omit
[bufname].
If [bufname] is not loaded, neocomplete will open
[bufname] automatically.
Note: It may take time considerably for the big buffer.
*:NeoCompleteDictionaryMakeCache*
:NeoCompleteDictionaryMakeCache [filetype]
Make a cache from a dictionary file with [filetype].
Selects the filetype of the current buffer if [filetype] is
omitted.
:NeoCompleteTagMakeCache *:NeoCompleteTagMakeCache*
Make a cache from a tags file in current buffer.
------------------------------------------------------------------------------
VARIABLES *neocomplete-variables*
*g:neocomplete#enable_at_startup*
g:neocomplete#enable_at_startup
neocomplete gets started automatically when Vim starts if
this value is 1.
With the default value 0, you cannot use neocomplete
unless you start it manually.
Note: This option has to be set in your .vimrc or _vimrc.
NOT IN the .gvimrc nor _gvimrc!
g:neocomplete#max_list *g:neocomplete#max_list*
This variable controls the number of candidates displayed in a
pop-up menu. If the list of candidates exceeds the limit, not
all candidates will show up.
Default value is 100.
*g:neocomplete#max_keyword_width*
g:neocomplete#max_keyword_width
This variable controls the indication width of a candidate
displayed in a pop-up menu. If the keyword length exceeds
the length it will be cut down properly.
Default value is 80.
*g:neocomplete#auto_completion_start_length*
g:neocomplete#auto_completion_start_length
This variable controls the number of the input completion
at the time of key input automatically.
Note: |g:neocomplete#auto_completion_start_length| is used
for "keyword" kind source only. Please refer to
|neocomplete-source-attribute-min_pattern_length|.
Default value is 2.
*g:neocomplete#manual_completion_start_length*
g:neocomplete#manual_completion_start_length
This variable controls the number of the input completion
at the time of manual completion. It is convenient when you
reduce this value, but may get heavy when you deleted a
letter in <C-h> or <BS> at popup indication time.
Default value is 0.
*g:neocomplete#min_keyword_length*
g:neocomplete#min_keyword_length
In a buffer or dictionary files, this variable controls
length of keyword becoming the targets of the completion at
the minimum.
Default value is 4.
*g:neocomplete#enable_ignore_case*
g:neocomplete#enable_ignore_case
When neocomplete looks for candidate completion, this
variable controls whether neocomplete ignores the upper-
and lowercase. If it is 1, neocomplete ignores case.
Default value is 'ignorecase'.
*g:neocomplete#enable_smart_case*
g:neocomplete#enable_smart_case
When a capital letter is included in input, neocomplete does
not ignore the upper- and lowercase.
Default value is 'infercase'.
*g:neocomplete#enable_camel_case*
g:neocomplete#enable_camel_case
When a capital letter is matched with the uppercase, but a
lower letter is matched with the upper- and lowercase.
Ex: "foB" is matched with "FooBar" not "foobar".
Note: This feature is only available in
|neocomplete-filter-matcher_fuzzy|.
Default value is 0.
*g:neocomplete#disable_auto_complete*
g:neocomplete#disable_auto_complete
This variable controls whether you invalidate automatic
completion. If it is 1, automatic completion becomes
invalid, but can use the manual completion by
|neocomplete#start_manual_complete()|.
Default value is 0.
*g:neocomplete#enable_cursor_hold_i*
g:neocomplete#enable_cursor_hold_i
This variable controls whether neocomplete use |CursorHoldI|
event when complete candidates.
Note: This option must be set before call
|:NeoCompleteEnable|.
Default value is 0.
*g:neocomplete#cursor_hold_i_time*
g:neocomplete#cursor_hold_i_time
If g:neocomplete#enable_cursor_hold_i is non-zero and in
insert mode, this value changes 'updatetime' option.
Default value is 300.
*g:neocomplete#enable_auto_select*
g:neocomplete#enable_auto_select
When neocomplete displays candidates, this option controls
whether neocomplete selects the first candidate
automatically. If you enable this option, neocomplete's
completion behavior is like |AutoComplPop|.
Note: If you want to enable the feature in
|g:neocomplete#force_omni_input_patterns|, you need Vim
7.4.775 or above.
Default value is 0.
*g:neocomplete#enable_auto_delimiter*
g:neocomplete#enable_auto_delimiter
This option controls whether neocomplete insert delimiter
automatically. For example, /(filename) or #(Vim script).
Default value is 0.
*g:neocomplete#enable_fuzzy_completion*
g:neocomplete#enable_fuzzy_completion
When you input one character, this variable controls whether
neocomplete takes an ambiguous searching as an end of the
words in it. For example, neocomplete comes to match it with
"public_html" or "PublicHtml" when you input it with "puh".
Note: The first letter must be matched.
Default value is 1.
*g:neocomplete#enable_multibyte_completion*
g:neocomplete#enable_multibyte_completion
If it is non-0, neocomplete can complete multibyte characters.
Note: This feature may conflict Input Method in Unix systems.
Note: To use multibyte completion, you must change
|g:neocomplete#keyword_patterns| variable.
Default value is 0.
*g:neocomplete#lock_buffer_name_pattern*
g:neocomplete#lock_buffer_name_pattern
This variable sets a pattern of the buffer name. If matched it,
neocomplete does not complete automatically. When it is an
empty character string, neocomplete will ignore it.
Default value is ''.
g:neocomplete#lock_iminsert *g:neocomplete#lock_iminsert*
If this variable is non-zero, neocomplete locks when
'iminsert' is non-zero.
Default value is 0.
g:neocomplete#data_directory *g:neocomplete#data_directory*
This variable appoints the directory that neocomplete
begins to write a file at one time. When there is not the
directory which appointed here, it is made. For example,
buffer.vim stores cache of the keyword in this
'buffer_cache' sub directory.
Default value is "$XDG_CACHE_HOME/neocomplete" or
expand("~/.cache/neocomplete"); the absolute path of it.
*g:neocomplete#keyword_patterns*
g:neocomplete#keyword_patterns
This dictionary records keyword patterns to completion.
This is appointed in regular expression every file type.
If the key is "_" or "default", it is used for default
pattern.
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
>
" Examples:
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns._ = '\h\w*'
<
*g:neocomplete#force_omni_input_patterns*
g:neocomplete#force_omni_input_patterns
This dictionary records keyword patterns to Omni completion.
This is appointed in regular expression every file type.
If this pattern is not defined or empty pattern, neocomplete
does not call 'omnifunc'.
Note: If it is a set, neocomplete will call 'omnifunc'
directly. So almost neocomplete features are disabled. But
all Omni completion works instead of
|g:neocomplete#sources#omni#input_patterns|.
>
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.ruby =
\ '[^. *\t]\.\w*\|\h\w*::'
<
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
*g:neocomplete#same_filetypes*
g:neocomplete#same_filetypes
It is a dictionary to connect file type mutually. It is
effective at time to let you refer to c and cpp mutually.
The value are comma-separated filetypes.
If the value contains "_", neocomplete completes from all
buffers. If the key is "_", the value will be used for default
same filetypes.
Note: neocomplete completes from same filetype buffers in
default.
>
if !exists('g:neocomplete#same_filetypes')
let g:neocomplete#same_filetypes = {}
endif
" In c buffers, completes from cpp and d buffers.
let g:neocomplete#same_filetypes.c = 'cpp,d'
" In cpp buffers, completes from c buffers.
let g:neocomplete#same_filetypes.cpp = 'c'
" In gitconfig buffers, completes from all buffers.
let g:neocomplete#same_filetypes.gitconfig = '_'
" In default, completes from all buffers.
let g:neocomplete#same_filetypes._ = '_'
<
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
Note: To disable neocomplete initialization, you must use
|neocomplete#disable_default_dictionary()|.
*g:neocomplete#text_mode_filetypes*
g:neocomplete#text_mode_filetypes
It is a dictionary to define text mode filetypes. The
dictionary's key is filetype and value is number. If the
value is non-zero, this filetype is text mode. In text mode,
neocomplete supports word conversion to write English.
For example, if you input "Fo", neocomplete will convert
candidate "foo" to "Foo". If you input "foo", neocomplete
will convert candidate "FooBar" to "foobar". If you input
"FO", neocomplete will convert candidate "foo" to "FOO".
Note: Text mode conversion is only used for "foobar" or
"Foobar" or "FOOBAR" words. Not "fooBar" or "FooBar".
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
*g:neocomplete#delimiter_patterns*
g:neocomplete#delimiter_patterns
This variable appoints a delimiter pattern to smart complete a
function. This is appointed in string list every file type.
Note: This string is not regular expression.
>
" Examples:
if !exists('g:neocomplete#delimiter_patterns')
let g:neocomplete#delimiter_patterns= {}
endif
let g:neocomplete#delimiter_patterns.vim = ['#']
let g:neocomplete#delimiter_patterns.cpp = ['::']
<
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
g:neocomplete#sources *g:neocomplete#sources*
It is a dictionary to decide use source names. The key is
filetype and the value is source names list. If the key is
"_", the value will be used for default filetypes. For
example, you can disable some sources in C++ filetype.
If the value is "_", it will load all sources.
Default value is {}.
>
" Examples:
if !exists('g:neocomplete#sources')
let g:neocomplete#sources = {}
endif
let g:neocomplete#sources._ = ['buffer']
let g:neocomplete#sources.cpp = ['buffer', 'dictionary']
<
b:neocomplete_sources *b:neocomplete_sources*
It is a list to decide use source names in buffer local.
>
" Examples:
" In cmdwin, only use vim source.
autocmd CmdwinEnter * let b:neocomplete_sources = ['vim']
<
*g:neocomplete#release_cache_time*
g:neocomplete#release_cache_time
This variable defines time of automatic released cache by a
second unit.
Default value is 900.
*g:neocomplete#tags_filter_patterns*
g:neocomplete#tags_filter_patterns
This dictionary records a pattern to filter a candidate in
the tag completion. For example, it can exclude a candidate
beginning in _ in file type of C/C++.
Because it is complicated, refer to
neocomplete#init#_variables() in
autoload/neocomplete/init.vim for the initial value.
g:neocomplete#use_vimproc *g:neocomplete#use_vimproc*
This variable is non 0, neocomplete uses |vimproc|.
Note: If this variable is non 0, neocomplete will make cache
asynchronously.
Default value is vimproc auto detection result.
*g:neocomplete#ignore_composite_filetypes*
g:neocomplete#ignore_composite_filetypes
It is a dictionary to ignore composite file type.
The dictionary's key is composite filetype and value is
filetype.
>
" Examples:
let g:neocomplete#ignore_composite_filetypes = {
\ 'ruby.spec' : 'ruby'
\ }
<
If you open filetype like "ruby.spec", completion is
intended for "ruby" and "spec".
But if you only want to complete "ruby" filetype,
you can set this variable to ignore "spec".
Default value is {}.
*g:neocomplete#skip_auto_completion_time*
g:neocomplete#skip_auto_completion_time
It is a string for skip auto completion.
If completion time is higher than it, neocomplete will skip
auto completion.
If it is "", the skip feature will be disabled.
Default value is "0.3".
{only available when compiled with the |+reltime| feature}
*g:neocomplete#enable_auto_close_preview*
g:neocomplete#enable_auto_close_preview
If it is non-zero, neocomplete will close preview window
automatically.
Default value is 0.
*g:neocomplete#fallback_mappings*
g:neocomplete#fallback_mappings
Neocomplete fallback mappings.
If you want to complete keywords by neocomplete and the
omnifunc, it is useful. >
" Search from neocomplete, omni candidates, vim keywords.
let g:neocomplete#fallback_mappings =
\ ["\<C-x>\<C-o>", "\<C-x>\<C-n>"]
<
Default value is [].
SOURCES VARIABLES *neocomplete-sources-variables*
*g:neocomplete#sources#buffer#cache_limit_size*
g:neocomplete#sources#buffer#cache_limit_size
This variable sets file size to make a cache of a file. If
open file is bigger than this size, neocomplete does not
make a cache.
Default value is 500000.
*g:neocomplete#sources#buffer#disabled_pattern*
g:neocomplete#sources#buffer#disabled_pattern
This variable sets a pattern of the buffer file path. If
matched it, neocomplete does not save a cache of the buffer.
When it is an empty character string, neocomplete will
ignore.
Default value is ''.
*g:neocomplete#sources#buffer#max_keyword_width*
g:neocomplete#sources#buffer#max_keyword_width
If the keyword length exceeds the length it will be not shown
in popup menu.
Default value is 80.
*g:neocomplete#sources#dictionary#dictionaries*
g:neocomplete#sources#dictionary#dictionaries
It is a dictionary to connect a dictionary file with file
type. The dictionary's key is filetype and comma-separated
multiple value is a path to a dictionary file. If the
variable is unset or has an empty key, the native 'dictionary'
option will be inherited. When you set "text"
key, you will appoint dictionary files in text mode. If the
key is "_", it is loaded in every filetype.
Note: Global 'dictionary' file is not loaded automatically.
Default value is {}.
*g:neocomplete#sources#member#prefix_patterns*
g:neocomplete#sources#member#prefix_patterns
This variable appoints a prefix pattern to complete a member
in buffer.
This is appointed in regular expression every file type.
If filetype key is not set, disable member completion.
Because it is complicated, refer in
autoload/neocomplete/sources/buffer.vim for the
initial value.
*g:neocomplete#sources#member#input_patterns*
g:neocomplete#sources#member#input_patterns
This variable appoints a keyword pattern to complete a member
in buffer.
This is appointed in regular expression every file type.
If filetype key is not set, use filetype "_" setting.
Because it is complicated, refer in
autoload/neocomplete/sources/buffer.vim for the
initial value.
*g:neocomplete#sources#omni#functions*
g:neocomplete#sources#omni#functions
This dictionary which appoints omni source call functions.
The key is |&filetype|. The value is omnifunc name String or
List of omnifunc name String.
If |g:neocomplete#sources#omni#functions| [|&filetype|] is
undefined, omni source calls 'omnifunc'.
If the key is "_", used for all filetypes.
Default value is {}.
*g:neocomplete#sources#omni#input_patterns*
g:neocomplete#sources#omni#input_patterns
This dictionary records keyword patterns used in
omni source. This is appointed in regular expression
every file type or 'omnifunc' name. If this pattern is not
defined or empty pattern, neocomplete does not call
'omnifunc'.
Note: ruby and php omnifunc are disabled, because they are too
slow.
Note: Partial omnifunc has problem when neocomplete call(Ex:
rubycomplete, jedi.vim, cocoa.vim and clang_complete). You
should |g:neocomplete#force_omni_input_patterns| instead.
Because it is complicated, refer to s:source.initialize()
autoload/neocomplete/sources/omni.vim for the
initial value.
>
" Examples:
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
let g:neocomplete#sources#omni#input_patterns.php =
\ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
let g:neocomplete#sources#omni#input_patterns.c =
\ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?'
<
*g:neocomplete#sources#tags#cache_limit_size*
g:neocomplete#sources#tags#cache_limit_size
This variable sets file size to make a cache of a file in
tag source. If open file is bigger than this size,
neocomplete does not make a tags cache.
Default value is 500000.
*g:neocomplete#sources#vim#complete_functions*
g:neocomplete#sources#vim#complete_functions
This dictionary which appoints vim source call function
when completes custom and customlist command. The key is
command name. The value is function name.
Default value is {}.
>
" Examples:
if !exists('g:neocomplete#sources#vim#complete_functions')
let g:neocomplete#sources#vim#complete_functions = {}
endif
let g:neocomplete#sources#vim#complete_functions.Ref =
\ 'ref#complete'
<
*g:neocomplete#ignore_source_files*
g:neocomplete#ignore_source_files
Ignore source filenames(not full path). You can optimize
source initialization.
Note: You cannot use the sources in ignored source files.
>
let g:neocomplete#ignore_source_files = ['tag.vim']
<
The default value is [].
------------------------------------------------------------------------------
FUNCTIONS *neocomplete-functions*
neocomplete#initialize() *neocomplete#initialize()*
Initialize neocomplete and sources.
Note: It enables neocomplete.
Note: You should call it in |VimEnter| autocmd.
User customization for neocomplete must be set before
initialization of neocomplete.
neocomplete#custom#source({source-name}, {option-name}, {value})
*neocomplete#custom#source()*
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.
These options below are available:
|neocomplete-source-attributes|
Note: User customization for neocomplete must be set before
initialization of neocomplete.
*neocomplete#custom_source()*
neocomplete#custom_source() is used for compatibility.
*neocomplete#get_context_filetype()*
neocomplete#get_context_filetype()
Get current context filetype of the cursor. This is smarter
than 'filetype' about handling nested filetypes.
Note: To enable context filetype feature, you must install
context_filetype.vim.
https://github.com/Shougo/context_filetype.vim
For example html filetype has javascript inside. Say, you have
a buffer which content is below with filetype is html.
>
<script type="text/javascript">
var x = 1;
</script>
<
At the line 1 and 3, neocomplete#get_context_filetype() is
"html" and at the line 2 it's "javascript", while at any
lines 'filetype' is "html".
*neocomplete#disable_default_dictionary()*
neocomplete#disable_default_dictionary({variable-name})
Disable default {variable-name} dictionary initialization.
Note: It must be called in .vimrc.
>
call neocomplete#disable_default_dictionary(
\ 'g:neocomplete#same_filetypes')
<
*neocomplete#get_default_matchers()*
neocomplete#get_default_matchers()
Get default matchers in current buffer.
*neocomplete#set_default_matchers()*
neocomplete#set_default_matchers({names})
Chang default matchers in current buffer.
>
call neocomplete#set_default_matchers('matcher_head')
<
------------------------------------------------------------------------------
KEY MAPPINGS *neocomplete-key-mappings*
*neocomplete#start_manual_complete()*
neocomplete#start_manual_complete([{sources}])
Use this function on inoremap <expr>. The keymapping call the
completion of neocomplete. When you rearrange the completion
of the Vim standard, you use it.
If you give {sources} argument, neocomplete call {sources}.
{sources} is name of source or list of sources name.
>
inoremap <expr><Tab> neocomplete#start_manual_complete()
<
*neocomplete#close_popup()*
neocomplete#close_popup()
Insert candidate and close popup menu for neocomplete.
>
inoremap <expr><C-y> neocomplete#close_popup()
<
*neocomplete#cancel_popup()*
neocomplete#cancel_popup()
Cancel completion menu for neocomplete.
>
inoremap <expr><C-e> neocomplete#cancel_popup()
<
*neocomplete#smart_close_popup()*
neocomplete#smart_close_popup()
Insert candidate and re-generate popup menu for neocomplete.
Unlike |neocomplete#close_popup()|, this function changes
behavior by |g:neocomplete#enable_auto_select| smart.
Note: This mapping is conflicted with |SuperTab| or |endwise|
plugins.
Note: This key mapping is for <C-h> or <BS> keymappings.
You should not use it for <CR>.
*neocomplete#undo_completion()*
neocomplete#undo_completion()
Use this function on inoremap <expr> to undo inputted
candidate. Because there is not mechanism to cancel
candidate in Vim, it will be convenient when it inflects.
>
inoremap <expr><C-g> neocomplete#undo_completion()
<
*neocomplete#complete_common_string()*
neocomplete#complete_common_string()
Use this function on inoremap <expr> to complete common
string in candidates. It will be convenient when candidates
have long common string.
>
inoremap <expr><C-l> neocomplete#complete_common_string()
inoremap <expr><Tab>
\ neocomplete#complete_common_string() != '' ?
\ neocomplete#complete_common_string() :
\ pumvisible() ? "\<C-n>" : "\<Tab>"
<
*<Plug>(neocomplete_start_unite_complete)*
<Plug>(neocomplete_start_unite_complete)
Start completion with |unite|.
Note: unite.vim Latest ver.3.0 or above is required.
Note: In unite interface, uses partial match instead of head
match.
*<Plug>(neocomplete_start_quick_match)*
<Plug>(neocomplete_start_unite_quick_match)
Start completion with |unite| and start quick match mode.
Note: unite.vim Latest ver.3.0 or above is required.
==============================================================================
EXAMPLES *neocomplete-examples*
>
" Note: This option must set it in .vimrc(_vimrc).
" NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplete#close_popup() : "\<Space>"
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
" Shell like behavior(not recommended).
"set completeopt+=longest
"let g:neocomplete#enable_auto_select = 1
"let g:neocomplete#disable_auto_complete = 1
"inoremap <expr><TAB> pumvisible() ? "\<Down>" :
" \ neocomplete#start_manual_complete()
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
"let g:neocomplete#sources#omni#input_patterns.php =
"\ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
"let g:neocomplete#sources#omni#input_patterns.c =
"\ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?'
"let g:neocomplete#sources#omni#input_patterns.cpp =
"\ '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
" For perlomni.vim setting.
" https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl =
\ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
" For smart TAB completion.
"inoremap <expr><TAB> pumvisible() ? "\<C-n>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ neocomplete#start_manual_complete()
" function! s:check_back_space() "{{{
" let col = col('.') - 1
" return !col || getline('.')[col - 1] =~ '\s'
" endfunction"}}}
<
==============================================================================
SOURCES *neocomplete-sources*
neocomplete reads automatically sources saved in an
autoload/neocomplete/sources directory.
buffer *neocomplete-source-buffer*
This source collects keywords from buffer.
member *neocomplete-source-member*
This source collects use of member variables from buffer.
tag *neocomplete-source-tag*
This source analyzes a tag file from tagfiles() for completion.
When a huge tag file (above
|g:neocomplete#sources#tags#cache_limit_size|) is set,
neocomplete does not make cache if you do not execute
|:NeoCompleteTagMakeCache| command. Because tag is
too slow if tag read a big tags file. You should use
more convenient include source completion now.
dictionary *neocomplete-source-dictionary*
This source adds candidates from 'dictionary' or
|g:neocomplete#sources#dictionary#dictionaries|.
file *neocomplete-source-file*
This source collects filename candidates.
Note: It is relative path to current buffer directory.
omni *neocomplete-source-omni*