-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathyoucompleteme.txt
4298 lines (3473 loc) · 180 KB
/
youcompleteme.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
*youcompleteme* YouCompleteMe: a code-completion engine for Vim
===============================================================================
Contents ~
1. Introduction |youcompleteme-introduction|
1. Help, Advice, Support |youcompleteme-help-advice-support|
2. Vundle |youcompleteme-vundle|
1. Contents |youcompleteme-contents|
2. Intro |youcompleteme-intro|
3. Installation |youcompleteme-installation|
1. Requirements |youcompleteme-requirements|
1. Supported Vim Versions |youcompleteme-supported-vim-versions|
2. Supported Python runtime |youcompleteme-supported-python-runtime|
3. Supported Compilers |youcompleteme-supported-compilers|
4. Individual completer requirements |youcompleteme-individual-completer-requirements|
2. macOS |youcompleteme-macos|
1. Quick start, installing all completers |youcompleteme-quick-start-installing-all-completers|
2. Explanation for the quick start |youcompleteme-explanation-for-quick-start|
3. Linux 64-bit |youcompleteme-linux-64-bit|
1. Quick start, installing all completers
2. Explanation for the quick start
4. Windows |youcompleteme-windows|
1. Quick start, installing all completers
2. Explanation for the quick start
5. Full Installation Guide |youcompleteme-full-installation-guide|
4. Quick Feature Summary |youcompleteme-quick-feature-summary|
1. General (all languages) |youcompleteme-general|
2. C-family languages (C, C++, Objective C, Objective C++, CUDA) |youcompleteme-c-family-languages|
3. C♯ |youcompleteme-c|
4. Python |youcompleteme-python|
5. Go |youcompleteme-go|
6. JavaScript and TypeScript |youcompleteme-javascript-typescript|
7. Rust |youcompleteme-rust|
8. Java |youcompleteme-java|
5. User Guide |youcompleteme-user-guide|
1. General Usage |youcompleteme-general-usage|
2. Client-Server Architecture |youcompleteme-client-server-architecture|
3. Completion String Ranking |youcompleteme-completion-string-ranking|
4. Signature Help |youcompleteme-signature-help|
1. Dismiss signature help |youcompleteme-dismiss-signature-help|
5. Semantic highlighting |youcompleteme-semantic-highlighting|
1. Customising the highlight groups |youcompleteme-customising-highlight-groups|
6. Inlay hints |youcompleteme-inlay-hints|
1. Highlight groups |youcompleteme-highlight-groups|
2. Options |youcompleteme-options|
3. Toggling |youcompleteme-toggling|
4. General Semantic Completion |youcompleteme-general-semantic-completion|
5. C-family Semantic Completion |youcompleteme-c-family-semantic-completion|
1. Installation
2. Compile flags |youcompleteme-compile-flags|
3. Option 1: Use a compilation database [53] |youcompleteme-option-1-use-compilation-database-53|
4. Option 2: Provide the flags manually |youcompleteme-option-2-provide-flags-manually|
5. Errors during compilation |youcompleteme-errors-during-compilation|
6. Java Semantic Completion |youcompleteme-java-semantic-completion|
1. Java Quick Start |youcompleteme-java-quick-start|
2. Java Project Files |youcompleteme-java-project-files|
3. Diagnostic display - Syntastic |youcompleteme-diagnostic-display-syntastic|
4. Diagnostic display - Eclim |youcompleteme-diagnostic-display-eclim|
5. Eclipse Projects |youcompleteme-eclipse-projects|
6. Maven Projects |youcompleteme-maven-projects|
7. Gradle Projects |youcompleteme-gradle-projects|
8. Troubleshooting |youcompleteme-troubleshooting|
7. C# Semantic Completion |youcompleteme-c-semantic-completion|
1. Automatically discovered solution files |youcompleteme-automatically-discovered-solution-files|
2. Manually specified solution files |youcompleteme-manually-specified-solution-files|
3. Use with .NET 6.0 and .NET SDKs |youcompleteme-use-with-.net-6.0-.net-sdks|
8. Python Semantic Completion |youcompleteme-python-semantic-completion|
1. Working with virtual environments |youcompleteme-working-with-virtual-environments|
2. Working with third-party packages |youcompleteme-working-with-third-party-packages|
3. Configuring through Vim options |youcompleteme-configuring-through-vim-options|
9. Rust Semantic Completion |youcompleteme-rust-semantic-completion|
10. Go Semantic Completion |youcompleteme-go-semantic-completion|
11. JavaScript and TypeScript Semantic Completion |youcompleteme-javascript-typescript-semantic-completion|
12. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages|
1. Plugging an arbitrary LSP server |youcompleteme-plugging-an-arbitrary-lsp-server|
2. LSP Configuration |youcompleteme-lsp-configuration|
3. Using 'omnifunc' for semantic completion |youcompleteme-using-omnifunc-for-semantic-completion|
13. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|
14. Diagnostic Display |youcompleteme-diagnostic-display|
1. Diagnostic Highlighting Groups |youcompleteme-diagnostic-highlighting-groups|
15. Symbol Search |youcompleteme-symbol-search|
1. Closing the popup |youcompleteme-closing-popup|
16. Type/Call Hierarchy |youcompleteme-type-call-hierarchy|
7. Commands |youcompleteme-commands|
1. The |:YcmRestartServer| command
2. The |:YcmForceCompileAndDiagnostics| command
3. The |:YcmDiags| command
4. The |:YcmShowDetailedDiagnostic| command
5. The |:YcmDebugInfo| command
6. The |:YcmToggleLogs| command
7. The |:YcmCompleter| command
8. YcmCompleter Subcommands |youcompleteme-ycmcompleter-subcommands|
1. GoTo Commands |youcompleteme-goto-commands|
1. The |GoToInclude| subcommand
2. The |GoToAlternateFile| subcommand
3. The |GoToDeclaration| subcommand
4. The |GoToDefinition| subcommand
5. The |GoTo| subcommand
6. The |GoToImprecise| subcommand
7. The 'GoToSymbol <symbol query>' subcommand |GoToSymbol-symbol-query|
8. The |GoToReferences| subcommand
9. The |GoToImplementation| subcommand
10. The |GoToImplementationElseDeclaration| subcommand
11. The |GoToType| subcommand
12. The |GoToDocumentOutline| subcommand
13. The |GoToCallers| and 'GoToCallees' subcommands
2. Semantic Information Commands |youcompleteme-semantic-information-commands|
1. The |GetType| subcommand
2. The |GetTypeImprecise| subcommand
3. The |GetParent| subcommand
4. The |GetDoc| subcommand
5. The |GetDocImprecise| subcommand
3. Refactoring Commands |youcompleteme-refactoring-commands|
1. The |FixIt| subcommand
2. The 'RefactorRename <new name>' subcommand |RefactorRename-new-name|
3. Python refactorings |youcompleteme-python-refactorings|
4. Multi-file Refactor |youcompleteme-multi-file-refactor|
5. The |Format| subcommand
6. The |OrganizeImports| subcommand
4. Miscellaneous Commands |youcompleteme-miscellaneous-commands|
1. The 'ExecuteCommand <args>' subcommand |ExecuteCommand-args|
2. The |RestartServer| subcommand
3. The |ReloadSolution| subcommand
9. Functions |youcompleteme-functions|
1. The |youcompleteme#GetErrorCount| function
2. The |youcompleteme#GetWarningCount| function
3. The 'youcompleteme#GetCommandResponse( ... )' function |youcompleteme#GetCommandResponse()|
4. The 'youcompleteme#GetCommandResponseAsync( callback, ... )' function |youcompleteme#GetCommandResponseAsync()|
10. Autocommands |youcompleteme-autocommands|
1. The |YcmLocationOpened| autocommand
2. The |YcmQuickFixOpened| autocommand
11. Options
1. The |g:ycm_min_num_of_chars_for_completion| option
2. The |g:ycm_min_num_identifier_candidate_chars| option
3. The |g:ycm_max_num_candidates| option
4. The |g:ycm_max_num_candidates_to_detail| option
5. The |g:ycm_max_num_identifier_candidates| option
6. The |g:ycm_auto_trigger| option
7. The |g:ycm_filetype_whitelist| option
8. The |g:ycm_filetype_blacklist| option
9. The |g:ycm_filetype_specific_completion_to_disable| option
10. The |g:ycm_filepath_blacklist| option
11. The |g:ycm_show_diagnostics_ui| option
12. The |g:ycm_error_symbol| option
13. The |g:ycm_warning_symbol| option
14. The |g:ycm_enable_diagnostic_signs| option
15. The |g:ycm_enable_diagnostic_highlighting| option
16. The |g:ycm_echo_current_diagnostic| option
17. The |g:ycm_auto_hover| option
18. The |g:ycm_filter_diagnostics| option
19. The |g:ycm_always_populate_location_list| option
20. The |g:ycm_open_loclist_on_ycm_diags| option
21. The |g:ycm_complete_in_comments| option
22. The |g:ycm_complete_in_strings| option
23. The |g:ycm_collect_identifiers_from_comments_and_strings| option
24. The |g:ycm_collect_identifiers_from_tags_files| option
25. The |g:ycm_seed_identifiers_with_syntax| option
26. The |g:ycm_extra_conf_vim_data| option
27. The |g:ycm_server_python_interpreter| option
28. The |g:ycm_keep_logfiles| option
29. The |g:ycm_log_level| option
30. The |g:ycm_auto_start_csharp_server| option
31. The |g:ycm_auto_stop_csharp_server| option
32. The |g:ycm_csharp_server_port| option
33. The |g:ycm_csharp_insert_namespace_expr| option
34. The |g:ycm_add_preview_to_completeopt| option
35. The |g:ycm_autoclose_preview_window_after_completion| option
36. The |g:ycm_autoclose_preview_window_after_insertion| option
37. The |g:ycm_max_diagnostics_to_display| option
38. The |g:ycm_key_list_select_completion| option
39. The |g:ycm_key_list_previous_completion| option
40. The |g:ycm_key_list_stop_completion| option
41. The |g:ycm_key_invoke_completion| option
42. The |g:ycm_key_detailed_diagnostics| option
43. The |g:ycm_show_detailed_diag_in_popup| option
44. The |g:ycm_global_ycm_extra_conf| option
45. The |g:ycm_confirm_extra_conf| option
46. The |g:ycm_extra_conf_globlist| option
47. The |g:ycm_filepath_completion_use_working_dir| option
48. The |g:ycm_semantic_triggers| option
49. The |g:ycm_cache_omnifunc| option
50. The |g:ycm_use_ultisnips_completer| option
51. The |g:ycm_goto_buffer_command| option
52. The |g:ycm_disable_for_files_larger_than_kb| option
53. The |g:ycm_use_clangd| option
54. The |g:ycm_clangd_binary_path| option
55. The |g:ycm_clangd_args| option
56. The |g:ycm_clangd_uses_ycmd_caching| option
57. The |g:ycm_language_server| option
58. The |g:ycm_disable_signature_help| option
59. The |g:ycm_signature_help_disable_syntax| option
60. The |g:ycm_gopls_binary_path| option
61. The |g:ycm_gopls_args| option
62. The |g:ycm_rls_binary_path| and 'g:ycm_rustc_binary_path' options
63. The |g:ycm_rust_toolchain_root| option
64. The |g:ycm_tsserver_binary_path| option
65. The |g:ycm_roslyn_binary_path| option
66. The |g:ycm_update_diagnostics_in_insert_mode| option
12. FAQ |youcompleteme-faq|
13. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct|
14. Contact |youcompleteme-contact|
15. License |youcompleteme-license|
16. Sponsorship |youcompleteme-sponsorship|
3. References |youcompleteme-references|
===============================================================================
*youcompleteme-introduction*
Introduction ~
Image: Gitter room [1] Image: Build status [3] Image: Coverage status [5]
-------------------------------------------------------------------------------
*youcompleteme-help-advice-support*
Help, Advice, Support ~
Looking for help, advice, or support? Having problems getting YCM to work?
First carefully read the installation instructions for your OS. We recommend
you use the supplied 'install.py' - the "full" installation guide is for rare,
advanced use cases and most users should use 'install.py'.
If the server isn't starting and you're getting a "YouCompleteMe unavailable"
error, check the Troubleshooting [7] guide.
Next, check the User Guide section on the semantic completer that you are
using. For C/C++/Objective-C/Objective-C++/CUDA, you _must_ read this section.
Finally, check the FAQ [8].
If, after reading the installation and user guides, and checking the FAQ,
you're still having trouble, check the contacts section below for how to get in
touch.
Please do **NOT** go to #vim on Freenode for support. Please contact the
YouCompleteMe maintainers directly using the contact details below.
===============================================================================
*youcompleteme-vundle*
Vundle ~
Please note that the below instructions suggest using Vundle. Currently there
are problems with Vundle, so here are some alternative instructions [9] using
Vim packages.
-------------------------------------------------------------------------------
*youcompleteme-contents*
Contents ~
- Intro
- Installation
- Requirements
- macOS
- Linux 64-bit
- Windows
- Full Installation Guide
- Quick Feature Summary
- User Guide
- General Usage
- Client-Server Architecture
- Completion String Ranking
- General Semantic Completion
- Signature Help
- Semantic Highlighting
- Inlay Hints
- C-family Semantic Completion
- Java Semantic Completion
- C# Semantic Completion
- Python Semantic Completion
- Rust Semantic Completion
- Go Semantic Completion
- JavaScript and TypeScript Semantic Completion
- Semantic Completion for Other Languages
- LSP Configuration
- Writing New Semantic Completers
- Diagnostic Display
- Diagnostic Highlighting Groups
- Symbol Search
- Type/Call Hierarchy
- Commands
- YcmCompleter subcommands
- GoTo Commands
- Semantic Information Commands
- Refactoring Commands
- Miscellaneous Commands
- Functions
- Autocommands
- Options
- FAQ
- Contributor Code of Conduct
- Contact
- License
- Sponsorship
-------------------------------------------------------------------------------
*youcompleteme-intro*
Intro ~
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion,
comprehension and refactoring engine for Vim [10].
It has several completion engines built-in and supports any protocol-compliant
Language Server, so can work with practically any language. YouCompleteMe
contains:
- an identifier-based engine that works with every programming language,
- a powerful clangd [11]-based engine that provides native semantic code
completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred
to as "the C-family languages"),
- a Jedi [12]-based completion engine for Python 2 and 3,
- an OmniSharp-Roslyn [13]-based completion engine for C#,
- a Gopls [14]-based completion engine for Go,
- a TSServer [15]-based completion engine for JavaScript and TypeScript,
- a rust-analyzer [16]-based completion engine for Rust,
- a jdt.ls [17]-based completion engine for Java.
- a generic Language Server Protocol implementation for any language
- and an omnifunc-based completer that uses data from Vim's omnicomplete
system to provide semantic completions for many other languages (Ruby, PHP,
etc.).
Image: YouCompleteMe GIF completion demo (see reference [18])
Here's an explanation of what happened in the last GIF demo above.
First, realize that **no keyboard shortcuts had to be pressed** to get the list
of completion candidates at any point in the demo. The user just types and the
suggestions pop up by themselves. If the user doesn't find the completion
suggestions relevant and/or just wants to type, they can do so; the completion
engine will not interfere.
When the user sees a useful completion string being offered, they press the TAB
key to accept it. This inserts the completion string. Repeated presses of the
TAB key cycle through the offered completions.
If the offered completions are not relevant enough, the user can continue
typing to further filter out unwanted completions.
A critical thing to notice is that the completion **filtering is NOT based on
the input being a string prefix of the completion** (but that works too). The
input needs to be a _subsequence [19] match_ of a completion. This is a fancy
way of saying that any input characters need to be present in a completion
string in the order in which they appear in the input. So 'abc' is a
subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated
sorting system ranks the completion strings so that the most relevant ones rise
to the top of the menu (so you usually need to press TAB just once).
**All of the above works with any programming language** because of the
identifier-based completion engine. It collects all of the identifiers in the
current file and other files you visit (and your tags files) and searches them
when you type (identifiers are put into per-filetype groups).
The demo also shows the semantic engine in use. When the user presses '.', '->'
or '::' while typing in insert mode (for C++; different triggers are used for
other languages), the semantic engine is triggered (it can also be triggered
with a keyboard shortcut; see the rest of the docs).
The last thing that you can see in the demo is YCM's diagnostic display
features (the little red X that shows up in the left gutter; inspired by
Syntastic [20]) if you are editing a C-family file. As the completer engine
compiles your file and detects warnings or errors, they will be presented in
various ways. You don't need to save your file or press any keyboard shortcut
to trigger this, it "just happens" in the background.
**And that's not all...**
YCM might be the only Vim completion engine with the correct Unicode support.
Though we do assume UTF-8 everywhere.
Image: YouCompleteMe GIF unicode demo (see reference [21])
YCM also provides semantic IDE-like features in a number of languages,
including:
- displaying signature help (argument hints) when entering the arguments to a
function call (Vim only)
- finding declarations, definitions, usages, etc. of identifiers, and an
interactive symbol finder
- displaying type information for classes, variables, functions etc.,
- displaying documentation for methods, members, etc. in the preview window,
or in a popup next to the cursor (Vim only)
- fixing common coding errors, like missing semi-colons, typos, etc.,
- semantic renaming of variables across files,
- formatting code,
- removing unused imports, sorting imports, etc.
For example, here's a demo of signature help:
Image: Signature Help Early Demo (see reference [22])
Below we can see YCM being able to do a few things:
- Retrieve references across files
- Go to declaration/definition
- Expand 'auto' in C++
- Fix some common errors, and provide refactorings, with |FixIt|
- Not shown in the GIF are |GoToImplementation| and |GoToType| for servers
that support it.
Image: YouCompleteMe GIF subcommands demo (see reference [23])
And here's some documentation being shown in a hover popup, automatically and
manually:
Image: hover demo (see reference [24])
Features vary by file type, so make sure to check out the file type feature
summary and the full list of completer subcommands to find out what's available
for your favourite languages.
You'll also find that YCM has filepath completers (try typing './' in a file)
and a completer that integrates with UltiSnips [25].
-------------------------------------------------------------------------------
*youcompleteme-installation*
Installation ~
-------------------------------------------------------------------------------
*youcompleteme-requirements*
Requirements ~
===============================================================================
| _Runtime_ | _Min Version_ | _Recommended Version (full support)_ | _Python_ |
===============================================================================
| Vim | 8.2.3995 | 9.0.214 | 3.8 |
-------------------------------------------------------------------------------
| Neovim | 0.5 | Vim 9.0.214 | 3.8 |
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*youcompleteme-supported-vim-versions*
Supported Vim Versions ~
Our policy is to support the Vim version that's in the latest LTS of Ubuntu.
That's currently Ubuntu 22.04 which contains 'vim-nox' at 'v8.2.3995'.
Vim must have a working Python 3 runtime.
For Neovim users, our policy is to require the latest released version.
Currently, Neovim 0.5.0 is required. Please note that some features are not
available in Neovim, and Neovim is not officially supported.
-------------------------------------------------------------------------------
*youcompleteme-supported-python-runtime*
Supported Python runtime ~
YCM has two components: A server and a client. Both the server and client
require Python 3.8 or later 3.x release.
For the Vim client, Vim must be, compiled with '--enable-shared' (or
'--enable-framework' on macOS). You can check if this is working with ':py3
import sys; print( sys.version)'. It should say something like '3.8.2 (...)'.
For Neovim, you must have a python 3.8 runtime and the Neovim python
extensions. See Neovim's ':help provider-python' for how to set that up.
For the server, you must run the 'install.py' script with a python 3.8 (or
later) runtime. Anaconda etc. are not supported. YCM will remember the runtime
you used to run 'install.py' and will use that when launching the server, so if
you usually use anaconda, then make sure to use the full path to a real
cpython3, e.g. '/usr/bin/python3 install.py --all' etc.
Our policy is to support the python3 version that's available in the latest
Ubuntu LTS (similar to our Vim version policy). We don't increase the Python
runtime version without a reason, though. Typically, we do this when the
current python version we're using goes out of support. At that time we will
typically pick a version that will be supported for a number of years.
-------------------------------------------------------------------------------
*youcompleteme-supported-compilers*
Supported Compilers ~
In order to provide the best possible performance and stability, ycmd has
updated its code to C++17. This requires a version bump of the minimum
supported compilers. The new requirements are:
===============================
| _Compiler_ | _Current Min_ |
===============================
| GCC | 8 |
-------------------------------
| Clang | 7 |
-------------------------------
| MSVC | 15.7 (VS 2017) |
-------------------------------
YCM requires CMake 3.13 or greater. If your CMake is too old, you may be able
to simply 'pip install --user cmake' to get a really new version.
-------------------------------------------------------------------------------
*youcompleteme-individual-completer-requirements*
Individual completer requirements ~
When enabling language support for a particular language, there may be runtime
requirements, such as needing a very recent Java Development Kit for Java
support. In general, YCM is not in control of the required versions for the
downstream compilers, though we do our best to signal where we know them.
-------------------------------------------------------------------------------
*youcompleteme-macos*
macOS ~
-------------------------------------------------------------------------------
*youcompleteme-quick-start-installing-all-completers*
Quick start, installing all completers ~
- Install YCM plugin via Vundle [26]
- Install CMake, MacVim and Python 3; Note that the pre-installed _macOS
system_ Vim is not supported (due to it having broken Python integration).
>
$ brew install cmake python go nodejs
<
- Install mono from Mono Project [27] (NOTE: on Intel Macs you can also 'brew
install mono'. On arm Macs, you may require Rosetta)
- For Java support you must install a JDK, one way to do this is with
Homebrew:
>
$ brew install java
$ sudo ln -sfn $(brew --prefix java)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
<
- Pre-installed macOS _system_ Vim does not support Python 3. So you need to
install either a Vim that supports Python 3 OR MacVim [28] with Homebrew
[29]:
- Option 1: Installing a Vim that supports Python 3
>
brew install vim
<
- Option 2: Installing MacVim [28]
>
brew install macvim
<
- Compile YCM.
- For Intel and arm64 Macs, the bundled libclang/clangd work:
>
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --all
<
- If you have troubles with finding system frameworks or C++ standard
library, try using the homebrew llvm:
>
brew install llvm
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --system-libclang --all
<
And edit your vimrc to add the following line to use the Homebrew llvm's
clangd:
>
" Use homebrew's clangd
let g:ycm_clangd_binary_path = trim(system('brew --prefix llvm')).'/bin/clangd'
<
- For using an arbitrary LSP server, check the relevant section
-------------------------------------------------------------------------------
*youcompleteme-explanation-for-quick-start*
Explanation for the quick start ~
These instructions (using 'install.py') are the quickest way to install
YouCompleteMe, however they may not work for everyone. If the following
instructions don't work for you, check out the full installation guide.
A supported Vim version with Python 3 is required. MacVim [28] is a good
option, even if you only use the terminal. YCM won't work with the
pre-installed Vim from Apple as its Python support is broken. If you don't
already use a Vim that supports Python 3 or MacVim [28], install it with
Homebrew [29]. Install CMake as well:
>
brew install vim cmake
<
OR
>
brew install macvim cmake
<
Install YouCompleteMe with Vundle [26].
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
will notify you to recompile it. You should then rerun the install process.
**NOTE:** If you want C-family completion, you MUST have the latest Xcode
installed along with the latest Command Line Tools (they are installed
automatically when you run 'clang' for the first time, or manually by running
'xcode-select --install')
Compiling YCM **with** semantic support for C-family languages through
**clangd**:
>
cd ~/.vim/bundle/YouCompleteMe
./install.py --clangd-completer
<
Compiling YCM **without** semantic support for C-family languages:
>
cd ~/.vim/bundle/YouCompleteMe
./install.py
<
The following additional language support options are available:
- C# support: install by downloading the Mono macOS package [30] and add
'--cs-completer' when calling 'install.py'.
- Go support: install Go [31] and add '--go-completer' when calling
'install.py'.
- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add
'--ts-completer' when calling 'install.py'.
- Rust support: add '--rust-completer' when calling 'install.py'.
- Java support: install JDK 17 [33] and add '--java-completer' when calling
'install.py'.
To simply compile with everything enabled, there's a '--all' flag. So, to
install with all language features, ensure 'xbuild', 'go', 'node' and 'npm'
tools are installed and in your 'PATH', then simply run:
>
cd ~/.vim/bundle/YouCompleteMe
./install.py --all
<
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
Don't forget that if you want the C-family semantic completion engine to work,
you will need to provide the compilation flags for your project to YCM. It's
all in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
-------------------------------------------------------------------------------
*youcompleteme-linux-64-bit*
Linux 64-bit ~
The following assume you're using Ubuntu 22.04.
-------------------------------------------------------------------------------
Quick start, installing all completers ~
- Install YCM plugin via Vundle [26]
- Install CMake, Vim and Python
>
apt install build-essential cmake vim-nox python3-dev
<
- Install mono-complete, go, node, java, and npm
>
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_current.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
apt install mono-complete golang nodejs openjdk-17-jdk openjdk-17-jre npm
<
- Compile YCM
>
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --all
<
- For plugging an arbitrary LSP server, check the relevant section
-------------------------------------------------------------------------------
Explanation for the quick start ~
These instructions (using 'install.py') are the quickest way to install
YouCompleteMe, however they may not work for everyone. If the following
instructions don't work for you, check out the full installation guide.
Make sure you have a supported version of Vim with Python 3 support and a
supported compiler. The latest LTS of Ubuntu is the minimum platform for simple
installation. For earlier releases or other distributions, you may have to do
some work to acquire the dependencies.
If your Vim version is too old, you may need to compile Vim from source [34]
(don't worry, it's easy).
Install YouCompleteMe with Vundle [26].
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
using Vundle and the 'ycm_core' library APIs have changed (which happens
rarely), YCM will notify you to recompile it. You should then rerun the
installation process.
Install development tools, CMake, and Python headers:
- Fedora-like distributions:
>
sudo dnf install cmake gcc-c++ make python3-devel
<
- Ubuntu LTS:
>
sudo apt install build-essential cmake3 python3-dev
<
Compiling YCM **with** semantic support for C-family languages through
**clangd**:
>
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --clangd-completer
<
Compiling YCM **without** semantic support for C-family languages:
>
cd ~/.vim/bundle/YouCompleteMe
python3 install.py
<
The following additional language support options are available:
- C# support: install Mono [35] and add '--cs-completer' when calling
'install.py'.
- Go support: install Go [31] and add '--go-completer' when calling
'install.py'.
- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add
'--ts-completer' when calling 'install.py'.
- Rust support: add '--rust-completer' when calling 'install.py'.
- Java support: install JDK 17 [33] and add '--java-completer' when calling
'install.py'.
To simply compile with everything enabled, there's a '--all' flag. So, to
install with all language features, ensure 'xbuild', 'go', 'node', and 'npm'
tools are installed and in your 'PATH', then simply run:
>
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --all
<
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
Don't forget that if you want the C-family semantic completion engine to work,
you will need to provide the compilation flags for your project to YCM. It's
all in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
-------------------------------------------------------------------------------
*youcompleteme-windows*
Windows ~
-------------------------------------------------------------------------------
Quick start, installing all completers ~
- Install YCM plugin via Vundle [26]
- Install Visual Studio Build Tools 2019 [36]
- Install CMake, Vim and Python
- Install go, node and npm
- Compile YCM
>
cd YouCompleteMe
python3 install.py --all
<
- Add 'set encoding=utf-8' to your vimrc [37]
- For plugging an arbitrary LSP server, check the relevant section
-------------------------------------------------------------------------------
Explanation for the quick start ~
These instructions (using 'install.py') are the quickest way to install
YouCompleteMe, however they may not work for everyone. If the following
instructions don't work for you, check out the full installation guide.
**Important:** we assume that you are using the 'cmd.exe' command prompt and
that you know how to add an executable to the PATH environment variable.
Make sure you have a supported Vim version with Python 3 support. You can check
the version and which Python is supported by typing ':version' inside Vim. Look
at the features included: '+python3/dyn' for Python 3. Take note of the Vim
architecture, i.e. 32 or 64-bit. It will be important when choosing the Python
installer. We recommend using a 64-bit client. Daily updated installers of
32-bit and 64-bit Vim with Python 3 support [38] are available.
Add the following line to your vimrc [37] if not already present.:
>
set encoding=utf-8
<
This option is required by YCM. Note that it does not prevent you from editing
a file in another encoding than UTF-8. You can do that by specifying the
'|++enc|' argument to the ':e' command.
Install YouCompleteMe with Vundle [26].
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
will notify you to recompile it. You should then rerun the install process.
Download and install the following software:
- Python 3 [39]. Be sure to pick the version corresponding to your Vim
architecture. It is _Windows x86_ for a 32-bit Vim and _Windows x86-64_ for
a 64-bit Vim. We recommend installing Python 3. Additionally, the version
of Python you install must match up exactly with the version of Python that
Vim is looking for. Type ':version' and look at the bottom of the page at
the list of compiler flags. Look for flags that look similar to
'-DDYNAMIC_PYTHON3_DLL=\"python36.dll\"'. This indicates that Vim is
looking for Python 3.6. You'll need one or the other installed, matching
the version number exactly.
- CMake [40]. Add CMake executable to the PATH environment variable.
- Build Tools for Visual Studio 2019 [36]. During setup, select _C++ build
tools_ in _Workloads_.
Compiling YCM **with** semantic support for C-family languages through
**clangd**:
>
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
python install.py --clangd-completer
<
Compiling YCM **without** semantic support for C-family languages:
>
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
python install.py
<
The following additional language support options are available:
- C# support: add '--cs-completer' when calling 'install.py'. Be sure that
the build utility 'msbuild' is in your PATH [41].
- Go support: install Go [31] and add '--go-completer' when calling
'install.py'.
- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add
'--ts-completer' when calling 'install.py'.
- Rust support: add '--rust-completer' when calling 'install.py'.
- Java support: install JDK 17 [33] and add '--java-completer' when calling
'install.py'.
To simply compile with everything enabled, there's a '--all' flag. So, to
install with all language features, ensure 'msbuild', 'go', 'node' and 'npm'
tools are installed and in your 'PATH', then simply run:
>
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
python install.py --all
<
You can specify the Microsoft Visual C++ (MSVC) version using the '--msvc'
option. YCM officially supports MSVC 15 (2017), MSVC 16 (Visual Studio 2019)
and MSVC 17 (Visual Studio 17 2022).
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
Don't forget that if you want the C-family semantic completion engine to work,
you will need to provide the compilation flags for your project to YCM. It's
all in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
-------------------------------------------------------------------------------
*youcompleteme-full-installation-guide*
Full Installation Guide ~
The full installation guide [42] has been moved to the wiki.
-------------------------------------------------------------------------------
*youcompleteme-quick-feature-summary*
Quick Feature Summary ~
-------------------------------------------------------------------------------
*youcompleteme-general*
General (all languages) ~
- Super-fast identifier completer including tags files and syntax elements
- Intelligent suggestion ranking and filtering
- File and path suggestions
- Suggestions from Vim's omnifunc
- UltiSnips snippet suggestions
-------------------------------------------------------------------------------
*youcompleteme-c-family-languages*
C-family languages (C, C++, Objective C, Objective C++, CUDA) ~
- Semantic auto-completion with automatic fixes
- Signature help
- Real-time diagnostic display
- Go to include/declaration/definition (|GoTo|, etc.)
- Go to alternate file (e.g. associated header |GoToAlternateFile|)
- Find Symbol ('GoToSymbol'), with interactive search
- Document outline (|GoToDocumentOutline|), with interactive search
- View documentation comments for identifiers (|GetDoc|)
- Type information for identifiers (|GetType|)
- Automatically fix certain errors (|FixIt|)
- Perform refactoring (|FixIt|)
- Reference finding (|GoToReferences|)
- Renaming symbols ('RefactorRename <new name>')
- Code formatting (|Format|)
- Semantic highlighting
- Inlay hints
- Type hierarchy
- Call hierarchy
-------------------------------------------------------------------------------
*youcompleteme-c*
C♯ ~
- Semantic auto-completion
- Signature help
- Real-time diagnostic display
- Go to declaration/definition (|GoTo|, etc.)
- Go to implementation (|GoToImplementation|)
- Find Symbol ('GoToSymbol'), with interactive search
- View documentation comments for identifiers (|GetDoc|)
- Type information for identifiers (|GetType|)
- Automatically fix certain errors (|FixIt|)
- Perform refactoring (|FixIt|)
- Management of OmniSharp-Roslyn server instance
- Renaming symbols ('RefactorRename <new name>')
- Code formatting (|Format|)
-------------------------------------------------------------------------------
*youcompleteme-python*
Python ~
- Semantic auto-completion
- Signature help
- Go to definition (|GoTo|)
- Find Symbol ('GoToSymbol'), with interactive search
- Reference finding (|GoToReferences|)
- View documentation comments for identifiers (|GetDoc|)
- Type information for identifiers (|GetType|)
- Renaming symbols ('RefactorRename <new name>')
-------------------------------------------------------------------------------
*youcompleteme-go*
Go ~
- Semantic auto-completion
- Signature help
- Real-time diagnostic display
- Go to declaration/definition (|GoTo|, etc.)
- Go to type definition (|GoToType|)
- Go to implementation (|GoToImplementation|)
- Document outline (|GoToDocumentOutline|), with interactive search
- Automatically fix certain errors (|FixIt|)
- Perform refactoring (|FixIt|)
- View documentation comments for identifiers (|GetDoc|)
- Type information for identifiers (|GetType|)
- Code formatting (|Format|)
- Management of 'gopls' server instance
- Inlay hints
- Call hierarchy
-------------------------------------------------------------------------------
*youcompleteme-javascript-typescript*
JavaScript and TypeScript ~
- Semantic auto-completion with automatic import insertion
- Signature help
- Real-time diagnostic display
- Go to definition (|GoTo|, |GoToDefinition|, and |GoToDeclaration| are
identical)
- Go to type definition (|GoToType|)
- Go to implementation (|GoToImplementation|)
- Find Symbol ('GoToSymbol'), with interactive search
- Reference finding (|GoToReferences|)
- View documentation comments for identifiers (|GetDoc|)
- Type information for identifiers (|GetType|)
- Automatically fix certain errors and perform refactoring (|FixIt|)
- Perform refactoring (|FixIt|)
- Renaming symbols ('RefactorRename <new name>')
- Code formatting (|Format|)
- Organize imports (|OrganizeImports|)
- Management of 'TSServer' server instance
- Inlay hints
- Call hierarchy
-------------------------------------------------------------------------------
*youcompleteme-rust*
Rust ~
- Semantic auto-completion
- Real-time diagnostic display
- Go to declaration/definition (|GoTo|, etc.)
- Go to implementation (|GoToImplementation|)
- Reference finding (|GoToReferences|)
- Document outline (|GoToDocumentOutline|), with interactive search
- View documentation comments for identifiers (|GetDoc|)
- Automatically fix certain errors (|FixIt|)
- Perform refactoring (|FixIt|)
- Type information for identifiers (|GetType|)
- Renaming symbols ('RefactorRename <new name>')
- Code formatting (|Format|)
- Management of 'rust-analyzer' server instance
- Semantic highlighting
- Inlay hints
- Call hierarchy
-------------------------------------------------------------------------------
*youcompleteme-java*
Java ~
- Semantic auto-completion with automatic import insertion