youcompleteme.txt 152 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622
  1. *youcompleteme.txt* YouCompleteMe: a code-completion engine for Vim
  2. ===============================================================================
  3. Contents ~
  4. 1. Introduction |youcompleteme-introduction|
  5. 2. NOTE: Minimum Requirements Have Changed |youcompleteme-note-minimum-requirements-have-changed|
  6. 3. Help, Advice, Support |youcompleteme-help-advice-support|
  7. 4. Contents |youcompleteme-contents|
  8. 5. Intro |youcompleteme-intro|
  9. 6. Installation |youcompleteme-installation|
  10. 1. Requirements |youcompleteme-requirements|
  11. 2. macOS |youcompleteme-macos|
  12. 1. Quick start, installing all completers |youcompleteme-quick-start-installing-all-completers|
  13. 2. Explanation for the quick start |youcompleteme-explanation-for-quick-start|
  14. 3. Linux 64-bit |youcompleteme-linux-64-bit|
  15. 1. Quick start, installing all completers
  16. 2. Explanation for the quick start
  17. 4. Windows |youcompleteme-windows|
  18. 1. Quick start, installing all completers
  19. 2. Explanation for the quick start
  20. 5. FreeBSD/OpenBSD |youcompleteme-freebsd-openbsd|
  21. 1. Quick start, installing all completers
  22. 2. Explanation for the quick start
  23. 6. Full Installation Guide |youcompleteme-full-installation-guide|
  24. 7. Quick Feature Summary |youcompleteme-quick-feature-summary|
  25. 1. General (all languages) |youcompleteme-general|
  26. 2. C-family languages (C, C++, Objective C, Objective C++, CUDA) |youcompleteme-c-family-languages|
  27. 3. C♯ |youcompleteme-c|
  28. 4. Python |youcompleteme-python|
  29. 5. Go |youcompleteme-go|
  30. 6. JavaScript and TypeScript |youcompleteme-javascript-typescript|
  31. 7. Rust |youcompleteme-rust|
  32. 8. Java |youcompleteme-java|
  33. 8. User Guide |youcompleteme-user-guide|
  34. 1. General Usage |youcompleteme-general-usage|
  35. 2. Client-Server Architecture |youcompleteme-client-server-architecture|
  36. 3. Completion String Ranking |youcompleteme-completion-string-ranking|
  37. 4. Signature Help |youcompleteme-signature-help|
  38. 5. General Semantic Completion |youcompleteme-general-semantic-completion|
  39. 6. C-family Semantic Completion |youcompleteme-c-family-semantic-completion|
  40. 1. Option 1: Use a compilation database [45] |youcompleteme-option-1-use-compilation-database-45|
  41. 2. Option 2: Provide the flags manually |youcompleteme-option-2-provide-flags-manually|
  42. 3. Errors during compilation |youcompleteme-errors-during-compilation|
  43. 7. Java Semantic Completion |youcompleteme-java-semantic-completion|
  44. 1. Java quick Start |youcompleteme-java-quick-start|
  45. 2. Java Project Files |youcompleteme-java-project-files|
  46. 3. Diagnostic display - Syntastic |youcompleteme-diagnostic-display-syntastic|
  47. 4. Diagnostic display - Eclim |youcompleteme-diagnostic-display-eclim|
  48. 5. Eclipse Projects |youcompleteme-eclipse-projects|
  49. 6. Maven Projects |youcompleteme-maven-projects|
  50. 7. Gradle Projects |youcompleteme-gradle-projects|
  51. 8. Troubleshooting |youcompleteme-troubleshooting|
  52. 8. C# Semantic Completion |youcompleteme-c-semantic-completion|
  53. 1. Automaticly discovered solution files |youcompleteme-automaticly-discovered-solution-files|
  54. 2. Manually specified solution files |youcompleteme-manually-specified-solution-files|
  55. 9. Python Semantic Completion |youcompleteme-python-semantic-completion|
  56. 1. Working with virtual environments |youcompleteme-working-with-virtual-environments|
  57. 2. Working with third-party packages |youcompleteme-working-with-third-party-packages|
  58. 3. Configuring through Vim options |youcompleteme-configuring-through-vim-options|
  59. 10. Rust Semantic Completion |youcompleteme-rust-semantic-completion|
  60. 11. Go Semantic Completion |youcompleteme-go-semantic-completion|
  61. 12. JavaScript and TypeScript Semantic Completion |youcompleteme-javascript-typescript-semantic-completion|
  62. 13. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages|
  63. 1. Plugging an arbitrary LSP server |youcompleteme-plugging-an-arbitrary-lsp-server|
  64. 2. LSP Configuration |youcompleteme-lsp-configuration|
  65. 3. Using 'omnifunc' for semantic completion |youcompleteme-using-omnifunc-for-semantic-completion|
  66. 14. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|
  67. 15. Diagnostic Display |youcompleteme-diagnostic-display|
  68. 1. Diagnostic Highlighting Groups |youcompleteme-diagnostic-highlighting-groups|
  69. 9. Commands |youcompleteme-commands|
  70. 1. The |:YcmRestartServer| command
  71. 2. The |:YcmForceCompileAndDiagnostics| command
  72. 3. The |:YcmDiags| command
  73. 4. The |:YcmShowDetailedDiagnostic| command
  74. 5. The |:YcmDebugInfo| command
  75. 6. The |:YcmToggleLogs| command
  76. 7. The |:YcmCompleter| command
  77. 10. YcmCompleter Subcommands |youcompleteme-ycmcompleter-subcommands|
  78. 1. GoTo Commands |youcompleteme-goto-commands|
  79. 1. The |GoToInclude| subcommand
  80. 2. The |GoToDeclaration| subcommand
  81. 3. The |GoToDefinition| subcommand
  82. 4. The |GoTo| subcommand
  83. 5. The |GoToImprecise| subcommand
  84. 6. The 'GoToSymbol <symbol query>' subcommand |GoToSymbol-symbol-query|
  85. 7. The |GoToReferences| subcommand
  86. 8. The |GoToImplementation| subcommand
  87. 9. The |GoToImplementationElseDeclaration| subcommand
  88. 10. The |GoToType| subcommand
  89. 2. Semantic Information Commands |youcompleteme-semantic-information-commands|
  90. 1. The |GetType| subcommand
  91. 2. The |GetTypeImprecise| subcommand
  92. 3. The |GetParent| subcommand
  93. 4. The |GetDoc| subcommand
  94. 5. The |GetDocImprecise| subcommand
  95. 3. Refactoring Commands |youcompleteme-refactoring-commands|
  96. 1. The |FixIt| subcommand
  97. 2. The 'RefactorRename <new name>' subcommand |RefactorRename-new-name|
  98. 3. Multi-file Refactor |youcompleteme-multi-file-refactor|
  99. 4. The |Format| subcommand
  100. 5. The |OrganizeImports| subcommand
  101. 4. Miscellaneous Commands |youcompleteme-miscellaneous-commands|
  102. 1. The 'ExecuteCommand <args>' subcommand |ExecuteCommand-args|
  103. 2. The |RestartServer| subcommand
  104. 3. The |ReloadSolution| subcommand
  105. 11. Functions |youcompleteme-functions|
  106. 1. The |youcompleteme#GetErrorCount| function
  107. 2. The |youcompleteme#GetWarningCount| function
  108. 3. The 'youcompleteme#GetCommandResponse( ... )' function |youcompleteme#GetCommandResponse()|
  109. 4. The 'youcompleteme#GetCommandResponseAsync( callback, ... )' function |youcompleteme#GetCommandResponseAsync()|
  110. 12. Autocommands |youcompleteme-autocommands|
  111. 1. The |YcmLocationOpened| autocommand
  112. 2. The |YcmQuickFixOpened| autocommand
  113. 13. Options |youcompleteme-options|
  114. 1. The |g:ycm_min_num_of_chars_for_completion| option
  115. 2. The |g:ycm_min_num_identifier_candidate_chars| option
  116. 3. The |g:ycm_max_num_candidates| option
  117. 4. The |g:ycm_max_num_candidates_to_detail| option
  118. 5. The |g:ycm_max_num_identifier_candidates| option
  119. 6. The |g:ycm_auto_trigger| option
  120. 7. The |g:ycm_filetype_whitelist| option
  121. 8. The |g:ycm_filetype_blacklist| option
  122. 9. The |g:ycm_filetype_specific_completion_to_disable| option
  123. 10. The |g:ycm_filepath_blacklist| option
  124. 11. The |g:ycm_show_diagnostics_ui| option
  125. 12. The |g:ycm_error_symbol| option
  126. 13. The |g:ycm_warning_symbol| option
  127. 14. The |g:ycm_enable_diagnostic_signs| option
  128. 15. The |g:ycm_enable_diagnostic_highlighting| option
  129. 16. The |g:ycm_echo_current_diagnostic| option
  130. 17. The |g:ycm_auto_hover| option
  131. 18. The |g:ycm_filter_diagnostics| option
  132. 19. The |g:ycm_always_populate_location_list| option
  133. 20. The |g:ycm_open_loclist_on_ycm_diags| option
  134. 21. The |g:ycm_complete_in_comments| option
  135. 22. The |g:ycm_complete_in_strings| option
  136. 23. The |g:ycm_collect_identifiers_from_comments_and_strings| option
  137. 24. The |g:ycm_collect_identifiers_from_tags_files| option
  138. 25. The |g:ycm_seed_identifiers_with_syntax| option
  139. 26. The |g:ycm_extra_conf_vim_data| option
  140. 27. The |g:ycm_server_python_interpreter| option
  141. 28. The |g:ycm_keep_logfiles| option
  142. 29. The |g:ycm_log_level| option
  143. 30. The |g:ycm_auto_start_csharp_server| option
  144. 31. The |g:ycm_auto_stop_csharp_server| option
  145. 32. The |g:ycm_csharp_server_port| option
  146. 33. The |g:ycm_csharp_insert_namespace_expr| option
  147. 34. The |g:ycm_add_preview_to_completeopt| option
  148. 35. The |g:ycm_autoclose_preview_window_after_completion| option
  149. 36. The |g:ycm_autoclose_preview_window_after_insertion| option
  150. 37. The |g:ycm_max_diagnostics_to_display| option
  151. 38. The |g:ycm_key_list_select_completion| option
  152. 39. The |g:ycm_key_list_previous_completion| option
  153. 40. The |g:ycm_key_list_stop_completion| option
  154. 41. The |g:ycm_key_invoke_completion| option
  155. 42. The |g:ycm_key_detailed_diagnostics| option
  156. 43. The |g:ycm_global_ycm_extra_conf| option
  157. 44. The |g:ycm_confirm_extra_conf| option
  158. 45. The |g:ycm_extra_conf_globlist| option
  159. 46. The |g:ycm_filepath_completion_use_working_dir| option
  160. 47. The |g:ycm_semantic_triggers| option
  161. 48. The |g:ycm_cache_omnifunc| option
  162. 49. The |g:ycm_use_ultisnips_completer| option
  163. 50. The |g:ycm_goto_buffer_command| option
  164. 51. The |g:ycm_disable_for_files_larger_than_kb| option
  165. 52. The |g:ycm_use_clangd| option
  166. 53. The |g:ycm_clangd_binary_path| option
  167. 54. The |g:ycm_clangd_args| option
  168. 55. The |g:ycm_clangd_uses_ycmd_caching| option
  169. 56. The |g:ycm_language_server| option
  170. 57. The |g:ycm_disable_signature_help| option
  171. 58. The |g:ycm_gopls_binary_path| option
  172. 59. The |g:ycm_gopls_args| option
  173. 60. The |g:ycm_rls_binary_path| and 'g:ycm_rustc_binary_path' options
  174. 61. The |g:ycm_rust_toolchain_root| option
  175. 62. The |g:ycm_tsserver_binary_path| option
  176. 63. The |g:ycm_roslyn_binary_path| option
  177. 14. FAQ |youcompleteme-faq|
  178. 15. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct|
  179. 16. Contact |youcompleteme-contact|
  180. 17. License |youcompleteme-license|
  181. 18. References |youcompleteme-references|
  182. ===============================================================================
  183. *youcompleteme-introduction*
  184. Introduction ~
  185. Image: Gitter room [1] Image: Build status [3] Image: Coverage status [5]
  186. ===============================================================================
  187. *youcompleteme-note-minimum-requirements-have-changed*
  188. NOTE: Minimum Requirements Have Changed ~
  189. Our policy is to support the Vim version that's in the latest LTS of Ubuntu.
  190. That's currently Ubuntu 20.04 which contains 'vim-nox' at 'v8.1.2269'.
  191. ===============================================================================
  192. *youcompleteme-help-advice-support*
  193. Help, Advice, Support ~
  194. Looking for help, advice or support? Having problems getting YCM to work?
  195. First carefully read the installation instructions for your OS. We recommend
  196. you use the supplied 'install.py' - the "full" installation guide is for rare,
  197. advanced use cases and most users should use 'install.py'.
  198. If the server isn't starting and you're getting a "YouCompleteMe unavailable"
  199. error, check the Troubleshooting [7] guide.
  200. Next check the User Guide section on the semantic completer that you are using.
  201. For C/C++/Objective-C/Objective-C++/CUDA, you _must_ read this section.
  202. Finally, check the FAQ [8].
  203. If, after reading the installation and user guides, and checking the FAQ,
  204. you're still having trouble, check the contacts section below for how to get in
  205. touch.
  206. Please do **NOT** go to #vim on freenode for support. Please contact the
  207. YouCompleteMe maintainers directly using the contact details below.
  208. ===============================================================================
  209. *youcompleteme-contents*
  210. Contents ~
  211. - Intro
  212. - Installation
  213. - Requirements
  214. - macOS
  215. - Linux 64-bit
  216. - Windows
  217. - FreeBSD/OpenBSD
  218. - Full Installation Guide
  219. - Quick Feature Summary
  220. - User Guide
  221. - General Usage
  222. - Client-Server Architecture
  223. - Completion String Ranking
  224. - General Semantic Completion
  225. - C-family Semantic Completion
  226. - Java Semantic Completion
  227. - C# Semantic Completion
  228. - Python Semantic Completion
  229. - Rust Semantic Completion
  230. - Go Semantic Completion
  231. - JavaScript and TypeScript Semantic Completion
  232. - Semantic Completion for Other Languages
  233. - LSP Configuration
  234. - Writing New Semantic Completers
  235. - Diagnostic Display
  236. - Diagnostic Highlighting Groups
  237. - Commands
  238. - YcmCompleter subcommands
  239. - GoTo Commands
  240. - Semantic Information Commands
  241. - Refactoring Commands
  242. - Miscellaneous Commands
  243. - Functions
  244. - Autocommands
  245. - Options
  246. - FAQ
  247. - Contributor Code of Conduct
  248. - Contact
  249. - License
  250. ===============================================================================
  251. *youcompleteme-intro*
  252. Intro ~
  253. YouCompleteMe is a fast, as-you-type, fuzzy-search code completion,
  254. comprehension and refactoring engine for Vim [9].
  255. It has several completion engines built in and supports any protocol-compliant
  256. Language Server, so can work with practically any language. YouCompleteMe
  257. contains:
  258. - an identifier-based engine that works with every programming language,
  259. - a powerful clangd [10]-based engine that provides native semantic code
  260. completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred
  261. to as "the C-family languages"),
  262. - a Jedi [11]-based completion engine for Python 2 and 3,
  263. - an OmniSharp-Roslyn [12]-based completion engine for C#,
  264. - a Gopls [13]-based completion engine for Go,
  265. - a TSServer [14]-based completion engine for JavaScript and TypeScript,
  266. - a rust-analyzer [15]-based completion engine for Rust,
  267. - a jdt.ls [16]-based completion engine for Java.
  268. - a generic Language Server Protocol implementation for any language
  269. - and an omnifunc-based completer that uses data from Vim's omnicomplete
  270. system to provide semantic completions for many other languages (Ruby, PHP
  271. etc.).
  272. Image: YouCompleteMe GIF completion demo (see reference [17])
  273. Here's an explanation of what happens in the last GIF demo above.
  274. First, realize that **no keyboard shortcuts had to be pressed** to get the list
  275. of completion candidates at any point in the demo. The user just types and the
  276. suggestions pop up by themselves. If the user doesn't find the completion
  277. suggestions relevant and/or just wants to type, they can do so; the completion
  278. engine will not interfere.
  279. When the user sees a useful completion string being offered, they press the TAB
  280. key to accept it. This inserts the completion string. Repeated presses of the
  281. TAB key cycle through the offered completions.
  282. If the offered completions are not relevant enough, the user can continue
  283. typing to further filter out unwanted completions.
  284. A critical thing to notice is that the completion **filtering is NOT based on
  285. the input being a string prefix of the completion** (but that works too). The
  286. input needs to be a _subsequence [18] match_ of a completion. This is a fancy
  287. way of saying that any input characters need to be present in a completion
  288. string in the order in which they appear in the input. So 'abc' is a
  289. subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated
  290. sorting system ranks the completion strings so that the most relevant ones rise
  291. to the top of the menu (so you usually need to press TAB just once).
  292. **All of the above works with any programming language** because of the
  293. identifier-based completion engine. It collects all of the identifiers in the
  294. current file and other files you visit (and your tags files) and searches them
  295. when you type (identifiers are put into per-filetype groups).
  296. The demo also shows the semantic engine in use. When the user presses '.', '->'
  297. or '::' while typing in insert mode (for C++; different triggers are used for
  298. other languages), the semantic engine is triggered (it can also be triggered
  299. with a keyboard shortcut; see the rest of the docs).
  300. The last thing that you can see in the demo is YCM's diagnostic display
  301. features (the little red X that shows up in the left gutter; inspired by
  302. Syntastic [19]) if you are editing a C-family file. As the completer engine
  303. compiles your file and detects warnings or errors, they will be presented in
  304. various ways. You don't need to save your file or press any keyboard shortcut
  305. to trigger this, it "just happens" in the background.
  306. **And that's not all...**
  307. YCM might be the only vim completion engine with the correct Unicode support.
  308. Though we do assume UTF-8 everywhere.
  309. Image: YouCompleteMe GIF unicode demo (see reference [20])
  310. YCM also provides semantic IDE-like features in a number of languages,
  311. including:
  312. - displaying signature help (argument hints) when entering the arguments to a
  313. function call (Vim only)
  314. - finding declarations, definitions, usages, etc. of identifiers,
  315. - displaying type information for classes, variables, functions etc.,
  316. - displaying documentation for methods, members, etc. in the preview window,
  317. or in a popup next to the cursor (Vim only)
  318. - fixing common coding errors, like missing semi-colons, typos, etc.,
  319. - semantic renaming of variables across files,
  320. - formatting code,
  321. - removing unused imports, sorting imports, etc.
  322. For example, here's a demo of signature help:
  323. Image: Signature Help Early Demo (see reference [21])
  324. Below we can see YCM being able to do a few things:
  325. - Retrieve references across files
  326. - Go to declaration/definition
  327. - Expand 'auto' in C++
  328. - Fix some common errors with |FixIt|
  329. - Not shown in the gif is |GoToImplementation| and |GoToType| for servers
  330. that support it.
  331. Image: YouCompleteMe GIF subcommands demo (see reference [22])
  332. And here's some documentation being shown in a hover popup, automatically and
  333. manually:
  334. Image: hover demo (see reference [23])
  335. Features vary by file type, so make sure to check out the file type feature
  336. summary and the full list of completer subcommands to find out what's available
  337. for your favourite languages.
  338. You'll also find that YCM has filepath completers (try typing './' in a file)
  339. and a completer that integrates with UltiSnips [24].
  340. ===============================================================================
  341. *youcompleteme-installation*
  342. Installation ~
  343. -------------------------------------------------------------------------------
  344. *youcompleteme-requirements*
  345. Requirements ~
  346. Minimum supported versions: - Vim v8.1.2269 huge build, compiled with Python
  347. 3.6 support (aka 'vim-nox' in Ubuntu 20.04 LTS) - Python 3.6 runtime, compiled
  348. with '--enable-shared' (or '--enable-framework')
  349. Please note that some features are not availble in Neovim, and Neovim is not
  350. officially supported.
  351. -------------------------------------------------------------------------------
  352. *youcompleteme-macos*
  353. macOS ~
  354. -------------------------------------------------------------------------------
  355. *youcompleteme-quick-start-installing-all-completers*
  356. Quick start, installing all completers ~
  357. - Install YCM plugin via Vundle [25]
  358. - Install cmake, macvim and python; Note that the _system_ vim is not
  359. supported.
  360. >
  361. brew install cmake macvim python mono go nodejs
  362. <
  363. - Compile YCM
  364. >
  365. cd ~/.vim/bundle/YouCompleteMe
  366. python3 install.py --all
  367. <
  368. - For plugging an arbitrary LSP server, check the relevant section
  369. -------------------------------------------------------------------------------
  370. *youcompleteme-explanation-for-quick-start*
  371. Explanation for the quick start ~
  372. These instructions (using 'install.py') are the quickest way to install
  373. YouCompleteMe, however they may not work for everyone. If the following
  374. instructions don't work for you, check out the full installation guide.
  375. MacVim [26] is required. YCM won't work with the pre-installed Vim from Apple
  376. as its Python support is broken. If you don't already use MacVim [26], install
  377. it with Homebrew [27]. Install CMake as well:
  378. >
  379. brew install cmake macvim
  380. <
  381. Install YouCompleteMe with Vundle [25].
  382. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM
  383. using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
  384. will notify you to recompile it. You should then rerun the install process.
  385. **NOTE:** If you want C-family completion, you MUST have the latest Xcode
  386. installed along with the latest Command Line Tools (they are installed
  387. automatically when you run 'clang' for the first time, or manually by running
  388. 'xcode-select --install')
  389. Compiling YCM **with** semantic support for C-family languages through
  390. **clangd**:
  391. >
  392. cd ~/.vim/bundle/YouCompleteMe
  393. ./install.py --clangd-completer
  394. <
  395. Compiling YCM **without** semantic support for C-family languages:
  396. >
  397. cd ~/.vim/bundle/YouCompleteMe
  398. ./install.py
  399. <
  400. The following additional language support options are available:
  401. - C# support: install Mono with Homebrew [27] or by downloading the Mono
  402. macOS package [28] and add '--cs-completer' when calling 'install.py'.
  403. - Go support: install Go [29] and add '--go-completer' when calling
  404. 'install.py'.
  405. - JavaScript and TypeScript support: install Node.js and npm [30] and add
  406. '--ts-completer' when calling 'install.py'.
  407. - Rust support: add '--rust-completer' when calling 'install.py'.
  408. - Java support: install JDK8 (version 8 required) [31] and add
  409. '--java-completer' when calling 'install.py'.
  410. To simply compile with everything enabled, there's a '--all' flag. You need to
  411. specify it manually by adding '--clangd-completer'. So, to install with all
  412. language features, ensure 'xbuild', 'go', 'node' and 'npm' tools are installed
  413. and in your 'PATH', then simply run:
  414. >
  415. cd ~/.vim/bundle/YouCompleteMe
  416. ./install.py --all
  417. <
  418. That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
  419. Don't forget that if you want the C-family semantic completion engine to work,
  420. you will need to provide the compilation flags for your project to YCM. It's
  421. all in the User Guide.
  422. YCM comes with sane defaults for its options, but you still may want to take a
  423. look at what's available for configuration. There are a few interesting options
  424. that are conservatively turned off by default that you may want to turn on.
  425. -------------------------------------------------------------------------------
  426. *youcompleteme-linux-64-bit*
  427. Linux 64-bit ~
  428. -------------------------------------------------------------------------------
  429. Quick start, installing all completers ~
  430. - Install YCM plugin via Vundle [25]
  431. - Install cmake, vim and python
  432. >
  433. apt install build-essential cmake vim python3-dev
  434. <
  435. - Install mono-complete, go, node and npm
  436. - Compile YCM
  437. >
  438. cd ~/.vim/bundle/YouCompleteMe
  439. python3 install.py --all
  440. <
  441. - For plugging an arbitrary LSP server, check the relevant section
  442. -------------------------------------------------------------------------------
  443. Explanation for the quick start ~
  444. These instructions (using 'install.py') are the quickest way to install
  445. YouCompleteMe, however they may not work for everyone. If the following
  446. instructions don't work for you, check out the full installation guide.
  447. Make sure you have Vim 7.4.1578 with Python 3 support. The Vim package on
  448. Fedora 27 and later and the pre-installed Vim on Ubuntu 16.04 and later are
  449. recent enough. You can see the version of Vim installed by running 'vim
  450. --version'. If the version is too old, you may need to compile Vim from source
  451. [32] (don't worry, it's easy).
  452. **NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
  453. Install YouCompleteMe with Vundle [25].
  454. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM
  455. using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
  456. will notify you to recompile it. You should then rerun the install process.
  457. Install development tools, CMake, and Python headers:
  458. - Fedora 27 and later:
  459. >
  460. sudo dnf install cmake gcc-c++ make python3-devel
  461. <
  462. - Ubuntu 14.04:
  463. >
  464. sudo apt install build-essential cmake3 python3-dev
  465. <
  466. - Ubuntu 16.04 and later:
  467. >
  468. sudo apt install build-essential cmake python3-dev
  469. <
  470. Compiling YCM **with** semantic support for C-family languages through
  471. **clangd**:
  472. >
  473. cd ~/.vim/bundle/YouCompleteMe
  474. python3 install.py --clangd-completer
  475. <
  476. Compiling YCM **without** semantic support for C-family languages:
  477. >
  478. cd ~/.vim/bundle/YouCompleteMe
  479. python3 install.py
  480. <
  481. The following additional language support options are available:
  482. - C# support: install Mono [33] and add '--cs-completer' when calling
  483. 'install.py'.
  484. - Go support: install Go [29] and add '--go-completer' when calling
  485. 'install.py'.
  486. - JavaScript and TypeScript support: install Node.js and npm [30] and add
  487. '--ts-completer' when calling 'install.py'.
  488. - Rust support: add '--rust-completer' when calling 'install.py'.
  489. - Java support: install JDK8 (version 8 required) [31] and add
  490. '--java-completer' when calling 'install.py'.
  491. To simply compile with everything enabled, there's a '--all' flag. You need to
  492. specify it manually by adding '--clangd-completer'. So, to install with all
  493. language features, ensure 'xbuild', 'go', 'node', 'npm' and tools are installed
  494. and in your 'PATH', then simply run:
  495. >
  496. cd ~/.vim/bundle/YouCompleteMe
  497. python3 install.py --all
  498. <
  499. That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
  500. Don't forget that if you want the C-family semantic completion engine to work,
  501. you will need to provide the compilation flags for your project to YCM. It's
  502. all in the User Guide.
  503. YCM comes with sane defaults for its options, but you still may want to take a
  504. look at what's available for configuration. There are a few interesting options
  505. that are conservatively turned off by default that you may want to turn on.
  506. -------------------------------------------------------------------------------
  507. *youcompleteme-windows*
  508. Windows ~
  509. -------------------------------------------------------------------------------
  510. Quick start, installing all completers ~
  511. - Install YCM plugin via Vundle [25]
  512. - Install Visual Studio Build Tools 2017 [34]
  513. - Install cmake, vim and python
  514. - Install go, node and npm
  515. - Compile YCM
  516. >
  517. cd YouCompleteMe
  518. python3 install.py --all
  519. <
  520. - Add 'set encoding=utf-8' to your vimrc [35]
  521. - For plugging an arbitrary LSP server, check the relevant section
  522. -------------------------------------------------------------------------------
  523. Explanation for the quick start ~
  524. These instructions (using 'install.py') are the quickest way to install
  525. YouCompleteMe, however they may not work for everyone. If the following
  526. instructions don't work for you, check out the full installation guide.
  527. **Important:** we assume that you are using the 'cmd.exe' command prompt and
  528. that you know how to add an executable to the PATH environment variable.
  529. Make sure you have at least Vim 7.4.1578 with Python 3 support. You can check
  530. the version and which Python is supported by typing ':version' inside Vim. Look
  531. at the features included: '+python3/dyn' for Python 3. Take note of the Vim
  532. architecture, i.e. 32 or 64-bit. It will be important when choosing the Python
  533. installer. We recommend using a 64-bit client. Daily updated installers of
  534. 32-bit and 64-bit Vim with Python 3 support [36] are available.
  535. **NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
  536. Add the line:
  537. >
  538. set encoding=utf-8
  539. <
  540. to your vimrc [35] if not already present. This option is required by YCM. Note
  541. that it does not prevent you from editing a file in another encoding than
  542. UTF-8. You can do that by specifying the '|++enc|' argument to the ':e'
  543. command.
  544. Install YouCompleteMe with Vundle [25].
  545. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM
  546. using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
  547. will notify you to recompile it. You should then rerun the install process.
  548. Download and install the following software:
  549. - Python 3 [37]. Be sure to pick the version corresponding to your Vim
  550. architecture. It is _Windows x86_ for a 32-bit Vim and _Windows x86-64_ for
  551. a 64-bit Vim. We recommend installing Python 3. Additionally, the version
  552. of Python you install must match up exactly with the version of Python that
  553. Vim is looking for. Type ':version' and look at the bottom of the page at
  554. the list of compiler flags. Look for flags that look similar to
  555. '-DDYNAMIC_PYTHON3_DLL=\"python36.dll\"'. This indicates that Vim is
  556. looking for Python 3.6. You'll need one or the other installed, matching
  557. the version number exactly.
  558. - CMake [38]. Add CMake executable to the PATH environment variable.
  559. - Visual Studio Build Tools 2017 [34]. During setup, select _Visual C++ build
  560. tools_ in _Workloads_.
  561. Compiling YCM **with** semantic support for C-family languages through
  562. **clangd**:
  563. >
  564. cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
  565. python install.py --clangd-completer
  566. <
  567. Compiling YCM **without** semantic support for C-family languages:
  568. >
  569. cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
  570. python install.py
  571. <
  572. The following additional language support options are available:
  573. - C# support: add '--cs-completer' when calling 'install.py'. Be sure that
  574. the build utility 'msbuild' is in your PATH [39].
  575. - Go support: install Go [29] and add '--go-completer' when calling
  576. 'install.py'.
  577. - JavaScript and TypeScript support: install Node.js and npm [30] and add
  578. '--ts-completer' when calling 'install.py'.
  579. - Rust support: add '--rust-completer' when calling 'install.py'.
  580. - Java support: install JDK8 (version 8 required) [31] and add
  581. '--java-completer' when calling 'install.py'.
  582. To simply compile with everything enabled, there's a '--all' flag. You need to
  583. specify it manually by adding '--clangd-completer'. So, to install with all
  584. language features, ensure 'msbuild', 'go', 'node' and 'npm' tools are installed
  585. and in your 'PATH', then simply run:
  586. >
  587. cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
  588. python install.py --all
  589. <
  590. You can specify the Microsoft Visual C++ (MSVC) version using the '--msvc'
  591. option. YCM officially supports MSVC 14 (Visual Studio 2015), 15 (2017) and
  592. MSVC 16 (Visual Studio 2019).
  593. That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
  594. Don't forget that if you want the C-family semantic completion engine to work,
  595. you will need to provide the compilation flags for your project to YCM. It's
  596. all in the User Guide.
  597. YCM comes with sane defaults for its options, but you still may want to take a
  598. look at what's available for configuration. There are a few interesting options
  599. that are conservatively turned off by default that you may want to turn on.
  600. -------------------------------------------------------------------------------
  601. *youcompleteme-freebsd-openbsd*
  602. FreeBSD/OpenBSD ~
  603. -------------------------------------------------------------------------------
  604. Quick start, installing all completers ~
  605. - Install YCM plugin via Vundle [25]
  606. - Install cmake
  607. >
  608. pkg install cmake
  609. <
  610. - Install xbuild, go, node and npm
  611. - Compile YCM
  612. >
  613. cd ~/.vim/bundle/YouCompleteMe
  614. python3 install.py --all
  615. <
  616. - For plugging an arbitrary LSP server, check the relevant section
  617. -------------------------------------------------------------------------------
  618. Explanation for the quick start ~
  619. These instructions (using 'install.py') are the quickest way to install
  620. YouCompleteMe, however they may not work for everyone. If the following
  621. instructions don't work for you, check out the full installation guide.
  622. **NOTE:** OpenBSD / FreeBSD are not officially supported platforms by YCM.
  623. Make sure you have Vim 7.4.1578 with Python 3 support.
  624. **NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
  625. OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version
  626. of Vim installed by running 'vim --version'.
  627. For FreeBSD 11.x, the requirement is cmake:
  628. >
  629. pkg install cmake
  630. <
  631. Install YouCompleteMe with Vundle [25].
  632. **Remember:** YCM is a plugin with a compiled component. If you **update** YCM
  633. using Vundle and the 'ycm_core' library APIs have changed (happens rarely), YCM
  634. will notify you to recompile it. You should then rerun the install process.
  635. Compiling YCM **with** semantic support for C-family languages through
  636. **clangd**:
  637. >
  638. cd ~/.vim/bundle/YouCompleteMe
  639. ./install.py --clangd-completer
  640. <
  641. Compiling YCM **without** semantic support for C-family languages:
  642. >
  643. cd ~/.vim/bundle/YouCompleteMe
  644. ./install.py
  645. <
  646. If the 'python' executable is not present, or the default 'python' is not the
  647. one that should be compiled against, specify the python interpreter explicitly:
  648. >
  649. python3 install.py --clangd-completer
  650. <
  651. The following additional language support options are available:
  652. - C# support: install Mono and add '--cs-completer' when calling
  653. './install.py'.
  654. - Go support: install Go [29] and add '--go-completer' when calling
  655. './install.py'.
  656. - JavaScript and TypeScript support: install Node.js and npm [30] and add
  657. '--ts-completer' when calling 'install.py'.
  658. - Rust support: add '--rust-completer' when calling './install.py'.
  659. - Java support: install JDK8 (version 8 required) [31] and add
  660. '--java-completer' when calling './install.py'.
  661. To simply compile with everything enabled, there's a '--all' flag. You need to
  662. specify it manually by adding '--clangd-completer'. So, to install with all
  663. language features, ensure 'xbuild', 'go', 'node', 'npm' and tools are installed
  664. and in your 'PATH', then simply run:
  665. >
  666. cd ~/.vim/bundle/YouCompleteMe
  667. ./install.py --all
  668. <
  669. That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
  670. Don't forget that if you want the C-family semantic completion engine to work,
  671. you will need to provide the compilation flags for your project to YCM. It's
  672. all in the User Guide.
  673. YCM comes with sane defaults for its options, but you still may want to take a
  674. look at what's available for configuration. There are a few interesting options
  675. that are conservatively turned off by default that you may want to turn on.
  676. -------------------------------------------------------------------------------
  677. *youcompleteme-full-installation-guide*
  678. Full Installation Guide ~
  679. The full installation guide [40] has been moved to the wiki.
  680. ===============================================================================
  681. *youcompleteme-quick-feature-summary*
  682. Quick Feature Summary ~
  683. -------------------------------------------------------------------------------
  684. *youcompleteme-general*
  685. General (all languages) ~
  686. - Super-fast identifier completer including tags files and syntax elements
  687. - Intelligent suggestion ranking and filtering
  688. - File and path suggestions
  689. - Suggestions from Vim's OmniFunc
  690. - UltiSnips snippet suggestions
  691. -------------------------------------------------------------------------------
  692. *youcompleteme-c-family-languages*
  693. C-family languages (C, C++, Objective C, Objective C++, CUDA) ~
  694. - Semantic auto-completion with automatic fixes
  695. - Signature help
  696. - Real-time diagnostic display
  697. - Go to include/declaration/definition (|GoTo|, etc.)
  698. - Find Symbol ('GoToSymbol')
  699. - View documentation comments for identifiers (|GetDoc|)
  700. - Type information for identifiers (|GetType|)
  701. - Automatically fix certain errors (|FixIt|)
  702. - Reference finding (|GoToReferences|)
  703. - Renaming symbols ('RefactorRename <new name>')
  704. - Code formatting (|Format|)
  705. -------------------------------------------------------------------------------
  706. *youcompleteme-c*
  707. C♯ ~
  708. - Semantic auto-completion
  709. - Signature help
  710. - Real-time diagnostic display
  711. - Go to declaration/definition (|GoTo|, etc.)
  712. - Go to implementation (|GoToImplementation|)
  713. - Find Symbol ('GoToSymbol')
  714. - View documentation comments for identifiers (|GetDoc|)
  715. - Type information for identifiers (|GetType|)
  716. - Automatically fix certain errors (|FixIt|)
  717. - Management of OmniSharp-Roslyn server instance
  718. - Renaming symbols ('RefactorRename <new name>')
  719. - Code formatting (|Format|)
  720. -------------------------------------------------------------------------------
  721. *youcompleteme-python*
  722. Python ~
  723. - Semantic auto-completion
  724. - Signature help
  725. - Go to definition (|GoTo|)
  726. - Find Symbol ('GoToSymbol')
  727. - Reference finding (|GoToReferences|)
  728. - View documentation comments for identifiers (|GetDoc|)
  729. - Type information for identifiers (|GetType|)
  730. - Renaming symbols ('RefactorRename <new name>')
  731. -------------------------------------------------------------------------------
  732. *youcompleteme-go*
  733. Go ~
  734. - Semantic auto-completion
  735. - Signature help
  736. - Real-time diagnostic display
  737. - Go to declaration/definition (|GoTo|, etc.)
  738. - Go to type definition (|GoToType|)
  739. - Go to implementation (|GoToImplementation|)
  740. - Automatically fix certain errors (|FixIt|)
  741. - View documentation comments for identifiers (|GetDoc|)
  742. - Type information for identifiers (|GetType|)
  743. - Code formatting (|Format|)
  744. - Management of 'gopls' server instance
  745. -------------------------------------------------------------------------------
  746. *youcompleteme-javascript-typescript*
  747. JavaScript and TypeScript ~
  748. - Semantic auto-completion with automatic import insertion
  749. - Signature help
  750. - Real-time diagnostic display
  751. - Go to definition (|GoTo|, |GoToDefinition|, and |GoToDeclaration| are
  752. identical)
  753. - Go to type definition (|GoToType|)
  754. - Go to implementation (|GoToImplementation|)
  755. - Find Symbol ('GoToSymbol')
  756. - Reference finding (|GoToReferences|)
  757. - View documentation comments for identifiers (|GetDoc|)
  758. - Type information for identifiers (|GetType|)
  759. - Automatically fix certain errors (|FixIt|)
  760. - Renaming symbols ('RefactorRename <new name>')
  761. - Code formatting (|Format|)
  762. - Organize imports (|OrganizeImports|)
  763. - Management of 'TSServer' server instance
  764. -------------------------------------------------------------------------------
  765. *youcompleteme-rust*
  766. Rust ~
  767. - Semantic auto-completion
  768. - Real-time diagnostic display
  769. - Go to declaration/definition (|GoTo|, etc.)
  770. - Go to implementation (|GoToImplementation|)
  771. - Reference finding (|GoToReferences|)
  772. - View documentation comments for identifiers (|GetDoc|)
  773. - Automatically fix certain errors (|FixIt|)
  774. - Type information for identifiers (|GetType|)
  775. - Renaming symbols ('RefactorRename <new name>')
  776. - Code formatting (|Format|)
  777. - Management of 'rust-analyzer' server instance
  778. -------------------------------------------------------------------------------
  779. *youcompleteme-java*
  780. Java ~
  781. - Semantic auto-completion with automatic import insertion
  782. - Signature help
  783. - Real-time diagnostic display
  784. - Go to definition (|GoTo|, |GoToDefinition|, and |GoToDeclaration| are
  785. identical)
  786. - Go to type definition (|GoToType|)
  787. - Go to implementation (|GoToImplementation|)
  788. - Find Symbol ('GoToSymbol')
  789. - Reference finding (|GoToReferences|)
  790. - View documentation comments for identifiers (|GetDoc|)
  791. - Type information for identifiers (|GetType|)
  792. - Automatically fix certain errors including code generation (|FixIt|)
  793. - Renaming symbols ('RefactorRename <new name>')
  794. - Code formatting (|Format|)
  795. - Organize imports (|OrganizeImports|)
  796. - Detection of java projects
  797. - Execute custom server command ('ExecuteCommand <args>')
  798. - Management of 'jdt.ls' server instance
  799. ===============================================================================
  800. *youcompleteme-user-guide*
  801. User Guide ~
  802. -------------------------------------------------------------------------------
  803. *youcompleteme-general-usage*
  804. General Usage ~
  805. If the offered completions are too broad, keep typing characters; YCM will
  806. continue refining the offered completions based on your input.
  807. Filtering is "smart-case" and "smart-diacritic [41]" sensitive; if you are
  808. typing only lowercase letters, then it's case-insensitive. If your input
  809. contains uppercase letters, then the uppercase letters in your query must match
  810. uppercase letters in the completion strings (the lowercase letters still match
  811. both). On top of that, a letter with no diacritic marks will match that letter
  812. with or without marks:
  813. ---------------------------------------------
  814. | _matches_ | _foo_ | _fôo_ | _fOo_ | _fÔo_ |
  815. ---------------------------------------------
  816. | _foo_ | ✔️ | ✔️ | ✔️ | ✔️ |
  817. ---------------------------------------------
  818. | _fôo_ | ❌ | ✔️ | ❌ | ✔️ |
  819. ---------------------------------------------
  820. | _fOo_ | ❌ | ❌ | ✔️ | ✔️ |
  821. ---------------------------------------------
  822. | _fÔo_ | ❌ | ❌ | ❌ | ✔️ |
  823. ---------------------------------------------
  824. Use the TAB key to accept a completion and continue pressing TAB to cycle
  825. through the completions. Use Shift-TAB to cycle backwards. Note that if you're
  826. using console Vim (that is, not Gvim or MacVim) then it's likely that the
  827. Shift-TAB binding will not work because the console will not pass it to Vim.
  828. You can remap the keys; see the Options section below.
  829. Knowing a little bit about how YCM works internally will prevent confusion. YCM
  830. has several completion engines: an identifier-based completer that collects all
  831. of the identifiers in the current file and other files you visit (and your tags
  832. files) and searches them when you type (identifiers are put into per-filetype
  833. groups).
  834. There are also several semantic engines in YCM. There are libclang-based and
  835. clangd-based completers that provide semantic completion for C-family
  836. languages. There's a Jedi-based completer for semantic completion for Python.
  837. There's also an omnifunc-based completer that uses data from Vim's omnicomplete
  838. system to provide semantic completions when no native completer exists for that
  839. language in YCM.
  840. There are also other completion engines, like the UltiSnips completer and the
  841. filepath completer.
  842. YCM automatically detects which completion engine would be the best in any
  843. situation. On occasion, it queries several of them at once, merges the outputs
  844. and presents the results to you.
  845. -------------------------------------------------------------------------------
  846. *youcompleteme-client-server-architecture*
  847. Client-Server Architecture ~
  848. YCM has a client-server architecture; the Vim part of YCM is only a thin client
  849. that talks to the ycmd HTTP+JSON server [42] that has the vast majority of YCM
  850. logic and functionality. The server is started and stopped automatically as you
  851. start and stop Vim.
  852. -------------------------------------------------------------------------------
  853. *youcompleteme-completion-string-ranking*
  854. Completion String Ranking ~
  855. The subsequence filter removes any completions that do not match the input, but
  856. then the sorting system kicks in. It's actually very complicated and uses lots
  857. of factors, but suffice it to say that "word boundary" (WB) subsequence
  858. character matches are "worth" more than non-WB matches. In effect, this means
  859. given an input of "gua", the completion "getUserAccount" would be ranked higher
  860. in the list than the "Fooguxa" completion (both of which are subsequence
  861. matches). A word-boundary character are all capital characters, characters
  862. preceded by an underscore and the first letter character in the completion
  863. string.
  864. -------------------------------------------------------------------------------
  865. *youcompleteme-signature-help*
  866. Signature Help ~
  867. Signature help is an **experimental** feature for which we value your feedback.
  868. Valid signatures are displayed in a second popup menu and the current signature
  869. is highlighed along with the current arguemnt.
  870. Signature help is triggered in insert mode automatically when
  871. |g:ycm_auto_trigger| is enabled and is not supported when it is not enabled.
  872. The signatures popup is hidden when there are no matching signatures or when
  873. you leave insert mode. There is no key binding to clear the popup.
  874. For more details on this feature and a few demos, check out the PR that
  875. proposed it [43].
  876. -------------------------------------------------------------------------------
  877. *youcompleteme-general-semantic-completion*
  878. General Semantic Completion ~
  879. You can use Ctrl+Space to trigger the completion suggestions anywhere, even
  880. without a string prefix. This is useful to see which top-level functions are
  881. available for use.
  882. -------------------------------------------------------------------------------
  883. *youcompleteme-c-family-semantic-completion*
  884. C-family Semantic Completion ~
  885. **NOTE:** YCM originally used the 'libclang' based engine for C-family, but
  886. users should migrate to clangd, as it provides more features and better
  887. performance. Users who rely on 'override_filename' in their
  888. '.ycm_extra_conf.py' will need to stay on the old 'libclang' engine.
  889. Instructions on how to stay on the old engine are available on the wiki [44].
  890. Advantages of clangd over libclang include:
  891. - **Project wide indexing**: Clangd has both dynamic and static index
  892. support. The dynamic index stores up-to-date symbols coming from any files
  893. you are currently editing, whereas static index contains project-wide
  894. symbol information. This symbol information is used for code completion and
  895. code navigation. Whereas libclang is limited to the current translation
  896. unit(TU).
  897. - **Code navigation**: Clangd provides all the GoTo requests libclang
  898. provides and it improves those using the above mentioned index information
  899. to contain project-wide information rather than just the current TU.
  900. - **Rename**: Clangd can perform semantic rename operations on the current
  901. file, whereas libclang doesn’t support such functionality.
  902. - **Code Completion**: Clangd can perform code completions at a lower latency
  903. than libclang; also, it has information about all the symbols in your
  904. project so it can suggest items outside your current TU and also provides
  905. proper '#include' insertions for those items.
  906. - **Signature help**: Clangd provides signature help so that you can see the
  907. names and types of arguments when calling functions.
  908. - **Format Code**: Clangd provides code formatting either for the selected
  909. lines or the whole file, whereas libclang doesn’t have such functionality.
  910. - **Performance**: Clangd has faster reparse and code completion times
  911. compared to libclang.
  912. In order to perform semantic analysis such as code completion, |GoTo| and
  913. diagnostics, YouCompleteMe uses 'clangd', which makes use of clang compiler,
  914. sometimes also referred to as llvm. Like any compiler, clang also requires a
  915. set of compile flags in order to parse your code. Simply put: If clang can't
  916. parse your code, YouCompleteMe can't provide semantic analysis.
  917. There are 2 methods which can be used to provide compile flags to clang:
  918. -------------------------------------------------------------------------------
  919. *youcompleteme-option-1-use-compilation-database-45*
  920. Option 1: Use a compilation database [45] ~
  921. The easiest way to get YCM to compile your code is to use a compilation
  922. database. A compilation database is usually generated by your build system
  923. (e.g. 'CMake') and contains the compiler invocation for each compilation unit
  924. in your project.
  925. For information on how to generate a compilation database, see the clang
  926. documentation [45]. In short:
  927. - If using CMake, add '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' when configuring
  928. (or add 'set( CMAKE_EXPORT_COMPILE_COMMANDS ON )' to 'CMakeLists.txt') and
  929. copy or symlink the generated database to the root of your project.
  930. - If using Ninja, check out the 'compdb' tool ('-t compdb') in its docs [46].
  931. - If using GNU make, check out compiledb [47] or Bear [48].
  932. - For other build systems, check out '.ycm_extra_conf.py' below.
  933. If no '.ycm_extra_conf.py' is found, YouCompleteMe automatically tries to load
  934. a compilation database if there is one.
  935. YCM looks for a file named 'compile_commands.json' in the directory of the
  936. opened file or in any directory above it in the hierarchy (recursively); when
  937. the file is found before a local '.ycm_extra_conf.py', YouCompleteMe stops
  938. searching the directories and lets clangd take over and handle the flags.
  939. -------------------------------------------------------------------------------
  940. *youcompleteme-option-2-provide-flags-manually*
  941. Option 2: Provide the flags manually ~
  942. If you don't have a compilation database, or aren't able to generate one, you
  943. have to tell YouCompleteMe how to compile your code some other way.
  944. Every C-family project is different. It is not possible for YCM to guess what
  945. compiler flags to supply for your project. Fortunately, YCM provides a
  946. mechanism for you to generate the flags for a particular file with _arbitrary
  947. complexity_. This is achieved by requiring you to provide a Python module which
  948. implements a trivial function which, given the file name as argument, returns a
  949. list of compiler flags to use to compile that file.
  950. YCM looks for a '.ycm_extra_conf.py' file in the directory of the opened file
  951. or in any directory above it in the hierarchy (recursively); when the file is
  952. found, it is loaded (only once!) as a Python module. YCM calls a 'Settings'
  953. method in that module which should provide it with the information necessary to
  954. compile the current file. You can also provide a path to a global configuration
  955. file with the |g:ycm_global_ycm_extra_conf| option, which will be used as a
  956. fallback. To prevent the execution of malicious code from a file you didn't
  957. write YCM will ask you once per '.ycm_extra_conf.py' if it is safe to load.
  958. This can be disabled and you can white-/blacklist files. See the
  959. |g:ycm_confirm_extra_conf| and |g:ycm_extra_conf_globlist| options
  960. respectively.
  961. This system was designed this way so that the user can perform any arbitrary
  962. sequence of operations to produce a list of compilation flags YCM should hand
  963. to Clang.
  964. **NOTE**: It is highly recommended to include '-x <language>' flag to libclang.
  965. This is so that the correct language is detected, particularly for header
  966. files. Common values are '-x c' for C, '-x c++' for C++, '-x objc' for
  967. Objective-C, and '-x cuda' for CUDA.
  968. To give you an impression, if your C++ project is trivial, and your usual
  969. compilation command is: 'g++ -Wall -Wextra -Werror -o FILE.o FILE.cc', then the
  970. following '.ycm_extra_conf.py' is enough to get semantic analysis from
  971. YouCompleteMe:
  972. >
  973. def Settings( **kwargs ):
  974. return {
  975. 'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-Werror' ],
  976. }
  977. <
  978. As you can see from the trivial example, YCM calls the 'Settings' method which
  979. returns a dictionary with a single element "'flags'". This element is a 'list'
  980. of compiler flags to pass to libclang for the current file. The absolute path
  981. of that file is accessible under the 'filename' key of the 'kwargs' dictionary.
  982. That's it! This is actually enough for most projects, but for complex projects
  983. it is not uncommon to integrate directly with an existing build system using
  984. the full power of the Python language.
  985. For a more elaborate example, see ycmd's own '.ycm_extra_conf.py' [49]. You
  986. should be able to use it _as a starting point_. **Don't** just copy/paste that
  987. file somewhere and expect things to magically work; **your project needs
  988. different flags**. Hint: just replace the strings in the 'flags' variable with
  989. compilation flags necessary for your project. That should be enough for 99% of
  990. projects.
  991. You could also consider using YCM-Generator [50] to generate the
  992. 'ycm_extra_conf.py' file.
  993. -------------------------------------------------------------------------------
  994. *youcompleteme-errors-during-compilation*
  995. Errors during compilation ~
  996. If Clang encounters errors when compiling the header files that your file
  997. includes, then it's probably going to take a long time to get completions. When
  998. the completion menu finally appears, it's going to have a large number of
  999. unrelated completion strings (type/function names that are not actually
  1000. members). This is because Clang fails to build a precompiled preamble for your
  1001. file if there are any errors in the included headers and that preamble is key
  1002. to getting fast completions.
  1003. Call the |:YcmDiags| command to see if any errors or warnings were detected in
  1004. your file.
  1005. -------------------------------------------------------------------------------
  1006. *youcompleteme-java-semantic-completion*
  1007. Java Semantic Completion ~
  1008. -------------------------------------------------------------------------------
  1009. *youcompleteme-java-quick-start*
  1010. Java quick Start ~
  1011. 1. Ensure that you have enabled the Java completer. See the installation
  1012. guide for details.
  1013. 2. Create a project file (gradle or maven) file in the root directory of
  1014. your Java project, by following the instructions below.
  1015. 3. (Optional) Configure the LSP server. The jdt.ls configuration options
  1016. [51] can be found in their codebase.
  1017. 4. If you previously used Eclim or Syntastic for Java, disable them for
  1018. Java.
  1019. 5. Edit a Java file from your project.
  1020. For the best experience, we highly recommend at least Vim 8.1.1875 when using
  1021. Java support with YouCompleteMe.
  1022. -------------------------------------------------------------------------------
  1023. *youcompleteme-java-project-files*
  1024. Java Project Files ~
  1025. In order to provide semantic analysis, the Java completion engine requires
  1026. knowledge of your project structure. In particular it needs to know the class
  1027. path to use, when compiling your code. Fortunately jdt.ls [16] supports eclipse
  1028. project files [52], maven projects [53] and gradle projects [54].
  1029. **NOTE:** Our recommendation is to use either maven or gradle projects.
  1030. -------------------------------------------------------------------------------
  1031. *youcompleteme-diagnostic-display-syntastic*
  1032. Diagnostic display - Syntastic ~
  1033. The native support for Java includes YCM's native realtime diagnostics display.
  1034. This can conflict with other diagnostics plugins like Syntastic, so when
  1035. enabling Java support, please **manually disable Syntastic Java diagnostics**.
  1036. Add the following to your 'vimrc':
  1037. >
  1038. let g:syntastic_java_checkers = []
  1039. <
  1040. -------------------------------------------------------------------------------
  1041. *youcompleteme-diagnostic-display-eclim*
  1042. Diagnostic display - Eclim ~
  1043. The native support for Java includes YCM's native realtime diagnostics display.
  1044. This can conflict with other diagnostics plugins like Eclim, so when enabling
  1045. Java support, please **manually disable Eclim Java diagnostics**.
  1046. Add the following to your 'vimrc':
  1047. >
  1048. let g:EclimFileTypeValidate = 0
  1049. <
  1050. **NOTE**: We recommend disabling Eclim entirely when editing Java with YCM's
  1051. native Java support. This can be done temporarily with ':EclimDisable'.
  1052. -------------------------------------------------------------------------------
  1053. *youcompleteme-eclipse-projects*
  1054. Eclipse Projects ~
  1055. Eclipse style projects require two files: .project [52] and .classpath [55].
  1056. If your project already has these files due to previously being set up within
  1057. eclipse, then no setup is required. jdt.ls [16] should load the project just
  1058. fine (it's basically eclipse after all).
  1059. However, if not, it is possible (easy in fact) to craft them manually, though
  1060. it is not recommended. You're better off using gradle or maven (see below).
  1061. A simple eclipse style project example [56] can be found in the ycmd test
  1062. directory. Normally all that is required is to copy these files to the root of
  1063. your project and to edit the '.classpath' to add additional libraries, such as:
  1064. >
  1065. <classpathentry kind="lib" path="/path/to/external/jar" />
  1066. <classpathentry kind="lib" path="/path/to/external/java/source" />
  1067. <
  1068. It may also be necessary to change the directory in which your source files are
  1069. located (paths are relative to the .project file itself):
  1070. >
  1071. <classpathentry kind="src" output="target/classes" path="path/to/src/" />
  1072. <
  1073. **NOTE**: The eclipse project and classpath files are not a public interface
  1074. and it is highly recommended to use Maven or Gradle project definitions if you
  1075. don't already use eclipse to manage your projects.
  1076. -------------------------------------------------------------------------------
  1077. *youcompleteme-maven-projects*
  1078. Maven Projects ~
  1079. Maven needs a file named pom.xml [53] in the root of the project. Once again a
  1080. simple pom.xml [57] can be found in ycmd source.
  1081. The format of pom.xml [53] files is way beyond the scope of this document, but
  1082. we do recommend using the various tools that can generate them for you, if
  1083. you're not familiar with them already.
  1084. -------------------------------------------------------------------------------
  1085. *youcompleteme-gradle-projects*
  1086. Gradle Projects ~
  1087. Gradle projects require a build.gradle [54]. Again, there is a trivial example
  1088. in ycmd's tests [58].
  1089. The format of build.gradle [54] files is way beyond the scope of this document,
  1090. but we do recommend using the various tools that can generate them for you, if
  1091. you're not familiar with them already.
  1092. -------------------------------------------------------------------------------
  1093. *youcompleteme-troubleshooting*
  1094. Troubleshooting ~
  1095. If you're not getting completions or diagnostics, check the server health:
  1096. - The Java completion engine takes a while to start up and parse your
  1097. project. You should be able to see its progress in the command line, and
  1098. |:YcmDebugInfo|. Ensure that the following lines are present:
  1099. >
  1100. -- jdt.ls Java Language Server running
  1101. -- jdt.ls Java Language Server Startup Status: Ready
  1102. <
  1103. - If the above lines don't appear after a few minutes, check the jdt.ls and
  1104. ycmd log files using |:YcmToggleLogs|. The jdt.ls log file is called '.log'
  1105. (for some reason).
  1106. If you get a message about "classpath is incomplete", then make sure you have
  1107. correctly configured the project files.
  1108. If you get messages about unresolved imports, then make sure you have correctly
  1109. configured the project files, in particular check that the classpath is set
  1110. correctly.
  1111. -------------------------------------------------------------------------------
  1112. *youcompleteme-c-semantic-completion*
  1113. C# Semantic Completion ~
  1114. YCM relies on OmniSharp-Roslyn [12] to provide completion and code navigation.
  1115. OmniSharp-Roslyn needs a solution file for a C# project and there are two ways
  1116. of letting YCM know about your solution files.
  1117. -------------------------------------------------------------------------------
  1118. *youcompleteme-automaticly-discovered-solution-files*
  1119. Automaticly discovered solution files ~
  1120. YCM will scan all parent directories of the file currently being edited and
  1121. look for file with '.sln' extension.
  1122. -------------------------------------------------------------------------------
  1123. *youcompleteme-manually-specified-solution-files*
  1124. Manually specified solution files ~
  1125. If YCM loads '.ycm_extra_conf.py' which contains 'CSharpSolutionFile' function,
  1126. YCM will try to use that to determine the solution file. This is useful when
  1127. one wants to override the default behaviour and specify a solution file that is
  1128. not in any of the parent directories of the currently edited file. Example:
  1129. >
  1130. def CSharpSolutionFile( filepath ):
  1131. # `filepath` is the path of the file user is editing
  1132. return '/path/to/solution/file' # Can be relative to the `.ycm_extra_conf.py`
  1133. <
  1134. If the path returned by 'CSharpSolutionFile' is not an actual file, YCM will
  1135. fall back to the other way of finding the file.
  1136. -------------------------------------------------------------------------------
  1137. *youcompleteme-python-semantic-completion*
  1138. Python Semantic Completion ~
  1139. YCM relies on the Jedi [11] engine to provide completion and code navigation.
  1140. By default, it will pick the version of Python running the ycmd server [42] and
  1141. use its 'sys.path'. While this is fine for simple projects, this needs to be
  1142. configurable when working with virtual environments or in a project with
  1143. third-party packages. The next sections explain how to do that.
  1144. -------------------------------------------------------------------------------
  1145. *youcompleteme-working-with-virtual-environments*
  1146. Working with virtual environments ~
  1147. A common practice when working on a Python project is to install its
  1148. dependencies in a virtual environment and develop the project inside that
  1149. environment. To support this, YCM needs to know the interpreter path of the
  1150. virtual environment. You can specify it by creating a '.ycm_extra_conf.py' file
  1151. at the root of your project with the following contents:
  1152. >
  1153. def Settings( **kwargs ):
  1154. return {
  1155. 'interpreter_path': '/path/to/virtual/environment/python'
  1156. }
  1157. <
  1158. where '/path/to/virtual/environment/python' is the path to the Python used by
  1159. the virtual environment you are working in. Typically, the executable can be
  1160. found in the 'Scripts' folder of the virtual environment directory on Windows
  1161. and in the 'bin' folder on other platforms.
  1162. If you don't like having to create a '.ycm_extra_conf.py' file at the root of
  1163. your project and would prefer to specify the interpreter path with a Vim
  1164. option, read the Configuring through Vim options section.
  1165. -------------------------------------------------------------------------------
  1166. *youcompleteme-working-with-third-party-packages*
  1167. Working with third-party packages ~
  1168. Another common practice is to put the dependencies directly into the project
  1169. and add their paths to 'sys.path' at runtime in order to import them. YCM needs
  1170. to be told about this path manipulation to support those dependencies. This can
  1171. be done by creating a '.ycm_extra_conf.py' file at the root of the project.
  1172. This file must define a 'Settings( **kwargs )' function returning a dictionary
  1173. with the list of paths to prepend to 'sys.path' under the 'sys_path' key. For
  1174. instance, the following '.ycm_extra_conf.py'
  1175. >
  1176. def Settings( **kwargs ):
  1177. return {
  1178. 'sys_path': [
  1179. '/path/to/some/third_party/package',
  1180. '/path/to/another/third_party/package'
  1181. ]
  1182. }
  1183. <
  1184. adds the paths '/path/to/some/third_party/package' and
  1185. '/path/to/another/third_party/package' at the start of 'sys.path'.
  1186. If you would rather prepend paths to 'sys.path' with a Vim option, read the
  1187. Configuring through Vim options section.
  1188. If you need further control on how to add paths to 'sys.path', you should
  1189. define the 'PythonSysPath( **kwargs )' function in the '.ycm_extra_conf.py'
  1190. file. Its keyword arguments are 'sys_path' which contains the default
  1191. 'sys.path', and 'interpreter_path' which is the path to the Python interpreter.
  1192. Here's a trivial example that insert the '/path/to/third_party/package' path at
  1193. the second position of 'sys.path':
  1194. >
  1195. def PythonSysPath( **kwargs ):
  1196. sys_path = kwargs[ 'sys_path' ]
  1197. sys_path.insert( 1, '/path/to/third_party/package' )
  1198. return sys_path
  1199. <
  1200. A more advanced example can be found in YCM's own '.ycm_extra_conf.py' [59].
  1201. -------------------------------------------------------------------------------
  1202. *youcompleteme-configuring-through-vim-options*
  1203. Configuring through Vim options ~
  1204. You may find inconvenient to have to create a '.ycm_extra_conf.py' file at the
  1205. root of each one of your projects in order to set the path to the Python
  1206. interpreter and/or add paths to 'sys.path' and would prefer to be able to
  1207. configure those through Vim options. Don't worry, this is possible by using the
  1208. |g:ycm_extra_conf_vim_data| option and creating a global extra configuration
  1209. file. Let's take an example. Suppose that you want to set the interpreter path
  1210. with the 'g:ycm_python_interpreter_path' option and prepend paths to 'sys.path'
  1211. with the 'g:ycm_python_sys_path' option. Suppose also that you want to name the
  1212. global extra configuration file 'global_extra_conf.py' and that you want to put
  1213. it in your HOME folder. You should then add the following lines to your vimrc:
  1214. >
  1215. let g:ycm_python_interpreter_path = ''
  1216. let g:ycm_python_sys_path = []
  1217. let g:ycm_extra_conf_vim_data = [
  1218. \ 'g:ycm_python_interpreter_path',
  1219. \ 'g:ycm_python_sys_path'
  1220. \]
  1221. let g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'
  1222. <
  1223. and create the '~/global_extra_conf.py' file with the following contents:
  1224. >
  1225. def Settings( **kwargs ):
  1226. client_data = kwargs[ 'client_data' ]
  1227. return {
  1228. 'interpreter_path': client_data[ 'g:ycm_python_interpreter_path' ],
  1229. 'sys_path': client_data[ 'g:ycm_python_sys_path' ]
  1230. }
  1231. <
  1232. That's it. You are done. Note that you don't need to restart the server when
  1233. setting one of the options. YCM will automatically pick the new values.
  1234. -------------------------------------------------------------------------------
  1235. *youcompleteme-rust-semantic-completion*
  1236. Rust Semantic Completion ~
  1237. YCM uses rust-analyzer [15] for Rust semantic completion.
  1238. NOTE: Previously, YCM used rls [60] for rust completion. This is no longer
  1239. supported, as the Rust community has decided on rust-analyzer [15] as the
  1240. future of Rust tooling.
  1241. Completions and GoTo commands within the current crate and its dependencies
  1242. should work out of the box with no additional configuration (provided that you
  1243. built YCM with the '--rust-completer' flag; see the _Installation_ section for
  1244. details). The install script takes care of installing the Rust source code
  1245. [61], so no configuration is necessary.
  1246. rust-analyzer supports a myriad of options. These are configured using LSP
  1247. configuration, but sadly don't appear to be documented at the time of writing.
  1248. However, there is some source code [62] which might help.
  1249. -------------------------------------------------------------------------------
  1250. *youcompleteme-go-semantic-completion*
  1251. Go Semantic Completion ~
  1252. Completions and GoTo commands should work out of the box (provided that you
  1253. built YCM with the '--go-completer' flag; see the _Installation_ section for
  1254. details). The server only works for projects with the "canonical" layout.
  1255. gopls also has a handful of undocumented options for which the source code [63]
  1256. is the only reference.
  1257. -------------------------------------------------------------------------------
  1258. *youcompleteme-javascript-typescript-semantic-completion*
  1259. JavaScript and TypeScript Semantic Completion ~
  1260. **NOTE:** YCM originally used the Tern [64] engine for JavaScript but due to
  1261. Tern [64] not being maintained anymore by its main author and the TSServer [14]
  1262. engine offering more features, YCM is moving to TSServer [14]. This won't
  1263. affect you if you were already using Tern [64] but you are encouraged to do the
  1264. switch by deleting the 'third_party/ycmd/third_party/tern_runtime/node_modules'
  1265. directory in YCM folder. If you are a new user but still want to use Tern [64],
  1266. you should pass the '--js-completer' option to the 'install.py' script during
  1267. installation. Further instructions on how to setup YCM with Tern [64] are
  1268. available on the wiki [65].
  1269. All JavaScript and TypeScript features are provided by the TSServer [14]
  1270. engine, which is included in the TypeScript SDK. To enable these features,
  1271. install Node.js and npm [30] and call the 'install.py' script with the
  1272. '--ts-completer' flag.
  1273. TSServer [14] relies on the 'jsconfig.json' file [66] for JavaScript and the
  1274. 'tsconfig.json' file [67] for TypeScript to analyze your project. Ensure the
  1275. file exists at the root of your project.
  1276. To get diagnostics in JavaScript, set the 'checkJs' option to 'true' in your
  1277. 'jsconfig.json' file:
  1278. >
  1279. {
  1280. "compilerOptions": {
  1281. "checkJs": true
  1282. }
  1283. }
  1284. <
  1285. -------------------------------------------------------------------------------
  1286. *youcompleteme-semantic-completion-for-other-languages*
  1287. Semantic Completion for Other Languages ~
  1288. C-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are
  1289. supported natively by YouCompleteMe using the Clang [68], OmniSharp-Roslyn
  1290. [12], Gopls [13], jdt.ls [16], Jedi [11], rust-analyzer [15], and TSServer [14]
  1291. engines, respectively. Check the installation section for instructions to
  1292. enable these features if desired.
  1293. -------------------------------------------------------------------------------
  1294. *youcompleteme-plugging-an-arbitrary-lsp-server*
  1295. Plugging an arbitrary LSP server ~
  1296. Similar to other LSP clients, YCM can use an arbitrary LSP server with the help
  1297. of |g:ycm_language_server| option. An example of a value of this option would
  1298. be:
  1299. >
  1300. let g:ycm_language_server =
  1301. \ [
  1302. \ {
  1303. \ 'name': 'yaml',
  1304. \ 'cmdline': [ '/path/to/yaml/server/yaml-language-server', '--stdio' ],
  1305. \ 'filetypes': [ 'yaml' ]
  1306. \ },
  1307. \ {
  1308. \ 'name': 'rust',
  1309. \ 'cmdline': [ 'ra_lsp_server' ],
  1310. \ 'filetypes': [ 'rust' ],
  1311. \ 'project_root_files': [ 'Cargo.toml' ]
  1312. \ },
  1313. \ {
  1314. \ 'name': 'godot',
  1315. \ 'filetypes': [ 'gdscript' ],
  1316. \ 'port': 6008,
  1317. \ 'project_root_files': [ 'project.godot' ]
  1318. \ }
  1319. \ ]
  1320. <
  1321. Each dictionary contains the following keys:
  1322. - 'name' (string, mandatory): When configuring a LSP server the value of the
  1323. 'name' key will be used as the "kwargs[ 'language' ]". Can be anything you
  1324. like.
  1325. - 'filetypes' (list of string, mandatory): List of Vim filetypes this server
  1326. should be used for.
  1327. - 'project_root_files' (list of string, optional): List of filenames to
  1328. search for when trying to determine the project root.
  1329. - 'cmdline' (list of string, optional): If supplied, the server is started
  1330. with this command line (each list element is a command line word).
  1331. Typically, the server should be started with STDIO communication. If not
  1332. supplied, 'port' must be supplied.
  1333. - 'port' (number, optional): If supplied, ycmd will connect to the server at
  1334. 'localhost:<port>' using TCP (remote servers are not supported).
  1335. - 'capabilities' (dict, optional): If supplied, this is a dictionary that is
  1336. merged with the LSP client capabilities reported to the language server.
  1337. This can be used to enable or disable certain features, such as the support
  1338. for configuraiton sections ('workspace/configuration').
  1339. See the LSP Examples [69] project for more examples of configuring the likes of
  1340. PHP, Ruby, Kotlin, and D.
  1341. -------------------------------------------------------------------------------
  1342. *youcompleteme-lsp-configuration*
  1343. LSP Configuration ~
  1344. Many LSP servers allow some level of user configuration. YCM enables this with
  1345. the help of '.ycm_extra_conf.py' files. Here's an example of jdt.ls user
  1346. examples of configuring the likes of PHP, Ruby, Kotlin, D, and many, many more.
  1347. >
  1348. def Settings( **kwargs ):
  1349. if kwargs[ 'language' ] == 'java':
  1350. return {
  1351. 'ls': {
  1352. 'java.format.onType.enabled': True
  1353. }
  1354. }
  1355. <
  1356. The 'ls' key tells YCM that the dictionary should be passed to the LSP server.
  1357. For each of the LSP server's configuration you should look up the respective
  1358. server's documentation.
  1359. Some servers request settings from arbitrary 'sections' of configuration. There
  1360. is no concept of configuration sections in vim, so you can specify an
  1361. additional 'config_sections' dictionary which maps section to a dictionary of
  1362. config required by the server. For example:
  1363. >
  1364. def Settings( **kwargs ):
  1365. if kwargs[ 'language' ] == 'java':
  1366. return {
  1367. 'ls': {
  1368. 'java.format.onType.enabled': True
  1369. },
  1370. 'config_sections': {
  1371. 'some section': {
  1372. 'some option': 'some value'
  1373. }
  1374. }
  1375. <
  1376. The sections and options/values are complete server-specific and rarely well
  1377. documented.
  1378. -------------------------------------------------------------------------------
  1379. *youcompleteme-using-omnifunc-for-semantic-completion*
  1380. Using 'omnifunc' for semantic completion ~
  1381. YCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for
  1382. semantic completions if it does not have a native semantic completion engine
  1383. for your file's filetype. Vim comes with okayish omnifuncs for various
  1384. languages like Ruby, PHP, etc. It depends on the language.
  1385. You can get a stellar omnifunc for Ruby with Eclim [70]. Just make sure you
  1386. have the _latest_ Eclim installed and configured (this means Eclim '>= 2.2.*'
  1387. and Eclipse '>= 4.2.*').
  1388. After installing Eclim remember to create a new Eclipse project within your
  1389. application by typing ':ProjectCreate <path-to-your-project> -n ruby' inside
  1390. vim and don't forget to have "let g:EclimCompletionMethod = 'omnifunc'" in your
  1391. vimrc. This will make YCM and Eclim play nice; YCM will use Eclim's omnifuncs
  1392. as the data source for semantic completions and provide the auto-triggering and
  1393. subsequence-based matching (and other YCM features) on top of it.
  1394. -------------------------------------------------------------------------------
  1395. *youcompleteme-writing-new-semantic-completers*
  1396. Writing New Semantic Completers ~
  1397. You have two options here: writing an 'omnifunc' for Vim's omnicomplete system
  1398. that YCM will then use through its omni-completer, or a custom completer for
  1399. YCM using the Completer API [71].
  1400. Here are the differences between the two approaches:
  1401. - You have to use VimScript to write the omnifunc, but get to use Python to
  1402. write for the Completer API; this by itself should make you want to use the
  1403. API.
  1404. - The Completer API is a _much_ more powerful way to integrate with YCM and
  1405. it provides a wider set of features. For instance, you can make your
  1406. Completer query your semantic back-end in an asynchronous fashion, thus not
  1407. blocking Vim's GUI thread while your completion system is processing stuff.
  1408. This is impossible with VimScript. All of YCM's completers use the
  1409. Completer API.
  1410. - Performance with the Completer API is better since Python executes faster
  1411. than VimScript.
  1412. If you want to use the 'omnifunc' system, see the relevant Vim docs with ':h
  1413. complete-functions'. For the Completer API, see the API docs [71].
  1414. If you want to upstream your completer into YCM's source, you should use the
  1415. Completer API.
  1416. -------------------------------------------------------------------------------
  1417. *youcompleteme-diagnostic-display*
  1418. Diagnostic Display ~
  1419. YCM will display diagnostic notifications for the C-family, C#, Go, Java,
  1420. JavaScript, Rust and TypeScript languages. Since YCM continuously recompiles
  1421. your file as you type, you'll get notified of errors and warnings in your file
  1422. as fast as possible.
  1423. Here are the various pieces of the diagnostic UI:
  1424. - Icons show up in the Vim gutter on lines that have a diagnostic.
  1425. - Regions of text related to diagnostics are highlighted (by default, a red
  1426. wavy underline in 'gvim' and a red background in 'vim').
  1427. - Moving the cursor to a line with a diagnostic echoes the diagnostic text.
  1428. - Vim's location list is automatically populated with diagnostic data (off by
  1429. default, see options).
  1430. The new diagnostics (if any) will be displayed the next time you press any key
  1431. on the keyboard. So if you stop typing and just wait for the new diagnostics to
  1432. come in, that _will not work_. You need to press some key for the GUI to
  1433. update.
  1434. Having to press a key to get the updates is unfortunate, but cannot be changed
  1435. due to the way Vim internals operate; there is no way that a background task
  1436. can update Vim's GUI after it has finished running. You _have to_ press a key.
  1437. This will make YCM check for any pending diagnostics updates.
  1438. You _can_ force a full, blocking compilation cycle with the
  1439. |:YcmForceCompileAndDiagnostics| command (you may want to map that command to a
  1440. key; try putting 'nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>' in your
  1441. vimrc). Calling this command will force YCM to immediately recompile your file
  1442. and display any new diagnostics it encounters. Do note that recompilation with
  1443. this command may take a while and during this time the Vim GUI _will_ be
  1444. blocked.
  1445. YCM will display a short diagnostic message when you move your cursor to the
  1446. line with the error. You can get a detailed diagnostic message with the
  1447. '<leader>d' key mapping (can be changed in the options) YCM provides when your
  1448. cursor is on the line with the diagnostic.
  1449. You can also see the full diagnostic message for all the diagnostics in the
  1450. current file in Vim's 'locationlist', which can be opened with the ':lopen' and
  1451. ':lclose' commands (make sure you have set 'let
  1452. g:ycm_always_populate_location_list = 1' in your vimrc). A good way to toggle
  1453. the display of the 'locationlist' with a single key mapping is provided by
  1454. another (very small) Vim plugin called ListToggle [72] (which also makes it
  1455. possible to change the height of the 'locationlist' window), also written by
  1456. yours truly.
  1457. -------------------------------------------------------------------------------
  1458. *youcompleteme-diagnostic-highlighting-groups*
  1459. Diagnostic Highlighting Groups ~
  1460. You can change the styling for the highlighting groups YCM uses. For the signs
  1461. in the Vim gutter, the relevant groups are:
  1462. - 'YcmErrorSign', which falls back to group 'SyntasticErrorSign' and then
  1463. 'error' if they exist
  1464. - 'YcmWarningSign', which falls back to group 'SyntasticWarningSign' and then
  1465. 'todo' if they exist
  1466. You can also style the line that has the warning/error with these groups:
  1467. - 'YcmErrorLine', which falls back to group 'SyntasticErrorLine' if it exists
  1468. - 'YcmWarningLine', which falls back to group 'SyntasticWarningLine' if it
  1469. exists
  1470. Note that the line highlighting groups only work when the
  1471. |g:ycm_enable_diagnostic_signs| option is set. If you want highlighted lines
  1472. but no signs in the Vim gutter, ensure that your Vim version is 7.4.2201 or
  1473. later and set the 'signcolumn' option to 'off' in your vimrc:
  1474. >
  1475. set signcolumn=off
  1476. <
  1477. The syntax groups used to highlight regions of text with errors/warnings: -
  1478. 'YcmErrorSection', which falls back to group 'SyntasticError' if it exists and
  1479. then 'SpellBad' - 'YcmWarningSection', which falls back to group
  1480. 'SyntasticWarning' if it exists and then 'SpellCap'
  1481. Here's how you'd change the style for a group:
  1482. >
  1483. highlight YcmErrorLine guibg=#3f0000
  1484. <
  1485. ===============================================================================
  1486. *youcompleteme-commands*
  1487. Commands ~
  1488. -------------------------------------------------------------------------------
  1489. The *:YcmRestartServer* command
  1490. If the ycmd completion server [42] suddenly stops for some reason, you can
  1491. restart it with this command.
  1492. -------------------------------------------------------------------------------
  1493. The *:YcmForceCompileAndDiagnostics* command
  1494. Calling this command will force YCM to immediately recompile your file and
  1495. display any new diagnostics it encounters. Do note that recompilation with this
  1496. command may take a while and during this time the Vim GUI _will_ be blocked.
  1497. You may want to map this command to a key; try putting 'nnoremap <F5>
  1498. :YcmForceCompileAndDiagnostics<CR>' in your vimrc.
  1499. -------------------------------------------------------------------------------
  1500. The *:YcmDiags* command
  1501. Calling this command will fill Vim's 'locationlist' with errors or warnings if
  1502. any were detected in your file and then open it. If a given error or warning
  1503. can be fixed by a call to ':YcmCompleter FixIt', then '(FixIt available)' is
  1504. appended to the error or warning text. See the |FixIt| completer subcommand for
  1505. more information.
  1506. **NOTE:** The absence of '(FixIt available)' does not strictly imply a fix-it
  1507. is not available as not all completers are able to provide this indication. For
  1508. example, the c-sharp completer provides many fix-its but does not add this
  1509. additional indication.
  1510. The |g:ycm_open_loclist_on_ycm_diags| option can be used to prevent the
  1511. location list from opening, but still have it filled with new diagnostic data.
  1512. See the _Options_ section for details.
  1513. -------------------------------------------------------------------------------
  1514. The *:YcmShowDetailedDiagnostic* command
  1515. This command shows the full diagnostic text when the user's cursor is on the
  1516. line with the diagnostic.
  1517. -------------------------------------------------------------------------------
  1518. The *:YcmDebugInfo* command
  1519. This will print out various debug information for the current file. Useful to
  1520. see what compile commands will be used for the file if you're using the
  1521. semantic completion engine.
  1522. -------------------------------------------------------------------------------
  1523. The *:YcmToggleLogs* command
  1524. This command presents the list of logfiles created by YCM, the ycmd server
  1525. [42], and the semantic engine server for the current filetype, if any. One of
  1526. these logfiles can be opened in the editor (or closed if already open) by
  1527. entering the corresponding number or by clicking on it with the mouse.
  1528. Additionally, this command can take the logfile names as arguments. Use the
  1529. '<TAB>' key (or any other key defined by the 'wildchar' option) to complete the
  1530. arguments or to cycle through them (depending on the value of the 'wildmode'
  1531. option). Each logfile given as an argument is directly opened (or closed if
  1532. already open) in the editor. Only for debugging purposes.
  1533. -------------------------------------------------------------------------------
  1534. The *:YcmCompleter* command
  1535. This command gives access to a number of additional IDE-like features in YCM,
  1536. for things like semantic GoTo, type information, FixIt and refactoring.
  1537. This command accepts a range that can either be specified through a selection
  1538. in one of Vim's visual modes (see ':h visual-use') or on the command line. For
  1539. instance, ':2,5YcmCompleter' will apply the command from line 2 to line 5. This
  1540. is useful for the |Format| subcommand.
  1541. Call 'YcmCompleter' without further arguments for a list of the commands you
  1542. can call for the current completer.
  1543. See the file type feature summary for an overview of the features available for
  1544. each file type. See the _YcmCompleter subcommands_ section for more information
  1545. on the available subcommands and their usage.
  1546. ===============================================================================
  1547. *youcompleteme-ycmcompleter-subcommands*
  1548. YcmCompleter Subcommands ~
  1549. **NOTE:** See the docs for the 'YcmCompleter' command before tackling this
  1550. section.
  1551. The invoked subcommand is automatically routed to the currently active semantic
  1552. completer, so ':YcmCompleter GoToDefinition' will invoke the |GoToDefinition|
  1553. subcommand on the Python semantic completer if the currently active file is a
  1554. Python one and on the Clang completer if the currently active file is a
  1555. C-family language one.
  1556. You may also want to map the subcommands to something less verbose; for
  1557. instance, 'nnoremap <leader>jd :YcmCompleter GoTo<CR>' maps the '<leader>jd'
  1558. sequence to the longer subcommand invocation.
  1559. -------------------------------------------------------------------------------
  1560. *youcompleteme-goto-commands*
  1561. GoTo Commands ~
  1562. These commands are useful for jumping around and exploring code. When moving
  1563. the cursor, the subcommands add entries to Vim's 'jumplist' so you can use
  1564. 'CTRL-O' to jump back to where you were before invoking the command (and
  1565. 'CTRL-I' to jump forward; see ':h jumplist' for details). If there is more than
  1566. one destination, the quickfix list (see ':h quickfix') is populated with the
  1567. available locations and opened to full width at the bottom of the screen. You
  1568. can change this behavior by using the |YcmQuickFixOpened| autocommand.
  1569. -------------------------------------------------------------------------------
  1570. The *GoToInclude* subcommand
  1571. Looks up the current line for a header and jumps to it.
  1572. Supported in filetypes: 'c, cpp, objc, objcpp, cuda'
  1573. -------------------------------------------------------------------------------
  1574. The *GoToDeclaration* subcommand
  1575. Looks up the symbol under the cursor and jumps to its declaration.
  1576. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1577. python, rust, typescript'
  1578. -------------------------------------------------------------------------------
  1579. The *GoToDefinition* subcommand
  1580. Looks up the symbol under the cursor and jumps to its definition.
  1581. **NOTE:** For C-family languages **this only works in certain situations**,
  1582. namely when the definition of the symbol is in the current translation unit. A
  1583. translation unit consists of the file you are editing and all the files you are
  1584. including with '#include' directives (directly or indirectly) in that file.
  1585. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1586. python, rust, typescript'
  1587. -------------------------------------------------------------------------------
  1588. The *GoTo* subcommand
  1589. This command tries to perform the "most sensible" GoTo operation it can.
  1590. Currently, this means that it tries to look up the symbol under the cursor and
  1591. jumps to its definition if possible; if the definition is not accessible from
  1592. the current translation unit, jumps to the symbol's declaration. For C-family
  1593. languages, it first tries to look up the current line for a header and jump to
  1594. it. For C#, implementations are also considered and preferred.
  1595. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1596. python, rust, typescript'
  1597. -------------------------------------------------------------------------------
  1598. The *GoToImprecise* subcommand
  1599. WARNING: This command trades correctness for speed!
  1600. Same as the |GoTo| command except that it doesn't recompile the file with
  1601. libclang before looking up nodes in the AST. This can be very useful when
  1602. you're editing files that take long to compile but you know that you haven't
  1603. made any changes since the last parse that would lead to incorrect jumps. When
  1604. you're just browsing around your codebase, this command can spare you quite a
  1605. bit of latency.
  1606. Supported in filetypes: 'c, cpp, objc, objcpp, cuda'
  1607. -------------------------------------------------------------------------------
  1608. *GoToSymbol-symbol-query*
  1609. The 'GoToSymbol <symbol query>' subcommand ~
  1610. Finds the definition of all symbols matching a specified string. Note that this
  1611. does not use any sort of smart/fuzzy matching.
  1612. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, java, javascript,
  1613. python, typescript'
  1614. -------------------------------------------------------------------------------
  1615. The *GoToReferences* subcommand
  1616. This command attempts to find all of the references within the project to the
  1617. identifier under the cursor and populates the quickfix list with those
  1618. locations.
  1619. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, python,
  1620. typescript, rust'
  1621. -------------------------------------------------------------------------------
  1622. The *GoToImplementation* subcommand
  1623. Looks up the symbol under the cursor and jumps to its implementation (i.e.
  1624. non-interface). If there are multiple implementations, instead provides a list
  1625. of implementations to choose from.
  1626. Supported in filetypes: 'cs, go, java, rust, typescript, javascript'
  1627. -------------------------------------------------------------------------------
  1628. The *GoToImplementationElseDeclaration* subcommand
  1629. Looks up the symbol under the cursor and jumps to its implementation if one,
  1630. else jump to its declaration. If there are multiple implementations, instead
  1631. provides a list of implementations to choose from.
  1632. Supported in filetypes: 'cs'
  1633. -------------------------------------------------------------------------------
  1634. The *GoToType* subcommand
  1635. Looks up the symbol under the cursor and jumps to the definition of its type
  1636. e.g. if the symbol is an object, go to the definition of its class.
  1637. Supported in filetypes: 'go, java, javascript, typescript'
  1638. -------------------------------------------------------------------------------
  1639. *youcompleteme-semantic-information-commands*
  1640. Semantic Information Commands ~
  1641. These commands are useful for finding static information about the code, such
  1642. as the types of variables, viewing declarations and documentation strings.
  1643. -------------------------------------------------------------------------------
  1644. The *GetType* subcommand
  1645. Echos the type of the variable or method under the cursor, and where it
  1646. differs, the derived type.
  1647. For example:
  1648. >
  1649. std::string s;
  1650. <
  1651. Invoking this command on 's' returns 'std::string => std::basic_string<char>'
  1652. **NOTE:** Causes re-parsing of the current translation unit.
  1653. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, go,
  1654. python, typescript, rust'
  1655. -------------------------------------------------------------------------------
  1656. The *GetTypeImprecise* subcommand
  1657. WARNING: This command trades correctness for speed!
  1658. Same as the |GetType| command except that it doesn't recompile the file with
  1659. libclang before looking up nodes in the AST. This can be very useful when
  1660. you're editing files that take long to compile but you know that you haven't
  1661. made any changes since the last parse that would lead to incorrect type. When
  1662. you're just browsing around your codebase, this command can spare you quite a
  1663. bit of latency.
  1664. Supported in filetypes: 'c, cpp, objc, objcpp, cuda'
  1665. -------------------------------------------------------------------------------
  1666. The *GetParent* subcommand
  1667. Echos the semantic parent of the point under the cursor.
  1668. The semantic parent is the item that semantically contains the given position.
  1669. For example:
  1670. >
  1671. class C {
  1672. void f();
  1673. };
  1674. void C::f() {
  1675. }
  1676. <
  1677. In the out-of-line definition of 'C::f', the semantic parent is the class 'C',
  1678. of which this function is a member.
  1679. In the example above, both declarations of 'C::f' have 'C' as their semantic
  1680. context, while the lexical context of the first 'C::f' is 'C' and the lexical
  1681. context of the second 'C::f' is the translation unit.
  1682. For global declarations, the semantic parent is the translation unit.
  1683. **NOTE:** Causes re-parsing of the current translation unit.
  1684. Supported in filetypes: 'c, cpp, objc, objcpp, cuda'
  1685. -------------------------------------------------------------------------------
  1686. The *GetDoc* subcommand
  1687. Displays the preview window populated with quick info about the identifier
  1688. under the cursor. Depending on the file type, this includes things like:
  1689. - The type or declaration of identifier,
  1690. - Doxygen/javadoc comments,
  1691. - Python docstrings,
  1692. - etc.
  1693. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1694. python, typescript, rust'
  1695. -------------------------------------------------------------------------------
  1696. The *GetDocImprecise* subcommand
  1697. WARNING: This command trades correctness for speed!
  1698. Same as the |GetDoc| command except that it doesn't recompile the file with
  1699. libclang before looking up nodes in the AST. This can be very useful when
  1700. you're editing files that take long to compile but you know that you haven't
  1701. made any changes since the last parse that would lead to incorrect docs. When
  1702. you're just browsing around your codebase, this command can spare you quite a
  1703. bit of latency.
  1704. Supported in filetypes: 'c, cpp, objc, objcpp, cuda'
  1705. -------------------------------------------------------------------------------
  1706. *youcompleteme-refactoring-commands*
  1707. Refactoring Commands ~
  1708. These commands make changes to your source code in order to perform refactoring
  1709. or code correction. YouCompleteMe does not perform any action which cannot be
  1710. undone, and never saves or writes files to the disk.
  1711. -------------------------------------------------------------------------------
  1712. The *FixIt* subcommand
  1713. Where available, attempts to make changes to the buffer to correct diagnostics
  1714. on the current line. Where multiple suggestions are available (such as when
  1715. there are multiple ways to resolve a given warning, or where multiple
  1716. diagnostics are reported for the current line), the options are presented and
  1717. one can be selected.
  1718. Completers which provide diagnostics may also provide trivial modifications to
  1719. the source in order to correct the diagnostic. Examples include syntax errors
  1720. such as missing trailing semi-colons, spurious characters, or other errors
  1721. which the semantic engine can deterministically suggest corrections.
  1722. If no fix-it is available for the current line, or there is no diagnostic on
  1723. the current line, this command has no effect on the current buffer. If any
  1724. modifications are made, the number of changes made to the buffer is echo'd and
  1725. the user may use the editor's undo command to revert.
  1726. When a diagnostic is available, and |g:ycm_echo_current_diagnostic| is set to
  1727. 1, then the text '(FixIt)' is appended to the echo'd diagnostic when the
  1728. completer is able to add this indication. The text '(FixIt available)' is also
  1729. appended to the diagnostic text in the output of the |:YcmDiags| command for
  1730. any diagnostics with available fix-its (where the completer can provide this
  1731. indication).
  1732. **NOTE:** Causes re-parsing of the current translation unit.
  1733. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1734. rust, typescript'
  1735. -------------------------------------------------------------------------------
  1736. *RefactorRename-new-name*
  1737. The 'RefactorRename <new name>' subcommand ~
  1738. In supported file types, this command attempts to perform a semantic rename of
  1739. the identifier under the cursor. This includes renaming declarations,
  1740. definitions and usages of the identifier, or any other language-appropriate
  1741. action. The specific behavior is defined by the semantic engine in use.
  1742. Similar to |FixIt|, this command applies automatic modifications to your source
  1743. files. Rename operations may involve changes to multiple files, which may or
  1744. may not be open in Vim buffers at the time. YouCompleteMe handles all of this
  1745. for you. The behavior is described in the following section.
  1746. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, python,
  1747. typescript, rust, cs'
  1748. -------------------------------------------------------------------------------
  1749. *youcompleteme-multi-file-refactor*
  1750. Multi-file Refactor ~
  1751. When a Refactor or FixIt command touches multiple files, YouCompleteMe attempts
  1752. to apply those modifications to any existing open, visible buffer in the
  1753. current tab. If no such buffer can be found, YouCompleteMe opens the file in a
  1754. new small horizontal split at the top of the current window, applies the
  1755. change, and then _hides_ the window. **NOTE:** The buffer remains open, and
  1756. must be manually saved. A confirmation dialog is opened prior to doing this to
  1757. remind you that this is about to happen.
  1758. Once the modifications have been made, the quickfix list (see ':help quickfix')
  1759. is populated with the locations of all modifications. This can be used to
  1760. review all automatic changes made by using ':copen'. Typically, use the 'CTRL-W
  1761. <enter>' combination to open the selected file in a new split. It is possible
  1762. to customize how the quickfix window is opened by using the |YcmQuickFixOpened|
  1763. autocommand.
  1764. The buffers are _not_ saved automatically. That is, you must save the modified
  1765. buffers manually after reviewing the changes from the quickfix list. Changes
  1766. can be undone using Vim's powerful undo features (see ':help undo'). Note that
  1767. Vim's undo is per-buffer, so to undo all changes, the undo commands must be
  1768. applied in each modified buffer separately.
  1769. **NOTE:** While applying modifications, Vim may find files which are already
  1770. open and have a swap file. The command is aborted if you select Abort or Quit
  1771. in any such prompts. This leaves the Refactor operation partially complete and
  1772. must be manually corrected using Vim's undo features. The quickfix list is
  1773. _not_ populated in this case. Inspect ':buffers' or equivalent (see ':help
  1774. buffers') to see the buffers that were opened by the command.
  1775. -------------------------------------------------------------------------------
  1776. The *Format* subcommand
  1777. This command formats the whole buffer or some part of it according to the value
  1778. of the Vim options 'shiftwidth' and 'expandtab' (see ":h 'sw'" and ':h et'
  1779. respectively). To format a specific part of your document, you can either
  1780. select it in one of Vim's visual modes (see ':h visual-use') and run the
  1781. command or directly enter the range on the command line, e.g. ':2,5YcmCompleter
  1782. Format' to format it from line 2 to line 5.
  1783. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, go,
  1784. typescript, rust, cs'
  1785. -------------------------------------------------------------------------------
  1786. The *OrganizeImports* subcommand
  1787. This command removes unused imports and sorts imports in the current file. It
  1788. can also group imports from the same module in TypeScript and resolves imports
  1789. in Java.
  1790. Supported in filetypes: 'java, javascript, typescript'
  1791. -------------------------------------------------------------------------------
  1792. *youcompleteme-miscellaneous-commands*
  1793. Miscellaneous Commands ~
  1794. These commands are for general administration, rather than IDE-like features.
  1795. They cover things like the semantic engine server instance and compilation
  1796. flags.
  1797. -------------------------------------------------------------------------------
  1798. *ExecuteCommand-args*
  1799. The 'ExecuteCommand <args>' subcommand ~
  1800. Some LSP completers (currently only Java completers) support executing
  1801. server specific commands. Consult the jdt.ls [16] documentation to find out
  1802. what commands are supported and which arguments are expected.
  1803. The support for 'ExecuteCommand' was implemented to support plugins like
  1804. vimspector [73] to debug java, but isn't limited to that specific use case.
  1805. -------------------------------------------------------------------------------
  1806. The *RestartServer* subcommand
  1807. Restarts the semantic-engine-as-localhost-server for those semantic engines
  1808. that work as separate servers that YCM talks to.
  1809. Supported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, go, java, javascript,
  1810. rust, typescript'
  1811. -------------------------------------------------------------------------------
  1812. The *ReloadSolution* subcommand
  1813. Instruct the Omnisharp-Roslyn server to clear its cache and reload all files
  1814. from disk. This is useful when files are added, removed, or renamed in the
  1815. solution, files are changed outside of Vim, or whenever Omnisharp-Roslyn cache
  1816. is out-of-sync.
  1817. Supported in filetypes: 'cs'
  1818. ===============================================================================
  1819. *youcompleteme-functions*
  1820. Functions ~
  1821. -------------------------------------------------------------------------------
  1822. The *youcompleteme#GetErrorCount* function
  1823. Get the number of YCM Diagnostic errors. If no errors are present, this
  1824. function returns 0.
  1825. For example:
  1826. >
  1827. call youcompleteme#GetErrorCount()
  1828. <
  1829. Both this function and |youcompleteme#GetWarningCount| can be useful when
  1830. integrating YCM with other Vim plugins. For example, a lightline [74] user
  1831. could add a diagnostics section to their statusline which would display the
  1832. number of errors and warnings.
  1833. -------------------------------------------------------------------------------
  1834. The *youcompleteme#GetWarningCount* function
  1835. Get the number of YCM Diagnostic warnings. If no warnings are present, this
  1836. function returns 0.
  1837. For example:
  1838. >
  1839. call youcompleteme#GetWarningCount()
  1840. <
  1841. -------------------------------------------------------------------------------
  1842. *youcompleteme#GetCommandResponse()*
  1843. The 'youcompleteme#GetCommandResponse( ... )' function ~
  1844. Run a completer subcommand and return the result as a string. This can be
  1845. useful for example to display the 'GetGoc' output in a popup window, e.g.:
  1846. >
  1847. let s:ycm_hover_popup = -1
  1848. function s:Hover()
  1849. let response = youcompleteme#GetCommandResponse( 'GetDoc' )
  1850. if response == ''
  1851. return
  1852. endif
  1853. call popup_hide( s:ycm_hover_popup )
  1854. let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )
  1855. endfunction
  1856. " CursorHold triggers in normal mode after a delay
  1857. autocmd CursorHold * call s:Hover()
  1858. " Or, if you prefer, a mapping:
  1859. nnoremap <silent> <leader>D :call <SID>Hover()<CR>
  1860. <
  1861. **NOTE**: This is only an example, for real hover support, see
  1862. |g:ycm_auto_hover|.
  1863. If the completer subcommand result is not a string (for example, it's a FixIt
  1864. or a Location), or if the completer subcommand raises an error, an empty string
  1865. is returned, so that calling code does not have to check for complex error
  1866. conditions.
  1867. The arguments to the function are the same as the arguments to the
  1868. |:YcmCompleter| ex command, e.g. the name of the subcommand, followed by any
  1869. additional subcommand arguments. As with the 'YcmCompleter' command, if the
  1870. first argument is 'ft=<filetype>' the request is targeted at the specified
  1871. filetype completer. This is an advanced usage and not necessary in most cases.
  1872. NOTE: The request is run synchronously and blocks Vim until the response is
  1873. received, so we do not recommend running this as part of an autocommand that
  1874. triggers frequently.
  1875. -------------------------------------------------------------------------------
  1876. *youcompleteme#GetCommandResponseAsync()*
  1877. The 'youcompleteme#GetCommandResponseAsync( callback, ... )' function ~
  1878. This works exactly like 'youcompleteme#GetCommandResponse', except that instead
  1879. of returning the result, you supply a 'callback' argument. This argument must
  1880. be a 'FuncRef' to a function taking a single argument 'response'. This callback
  1881. will be called with the command response at some point later, or immediately.
  1882. As with |youcompleteme#GetCommandResponse()|, this function will call the
  1883. callback with "''" (an empty string) if the request is not sent, or if there
  1884. was some sort of error.
  1885. Here's an example that's similar to the one above:
  1886. >
  1887. let s:ycm_hover_popup = -1
  1888. function! s:ShowDataPopup( response ) abort
  1889. if response == ''
  1890. return
  1891. endif
  1892. call popup_hide( s:ycm_hover_popup )
  1893. let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )
  1894. endfunction
  1895. function! s:GetData() abort
  1896. call youcompleteme#GetCommandResponseAsync(
  1897. \ function( 's:ShowDataPopup' ),
  1898. \ 'GetDoc' )
  1899. endfunction
  1900. autocommand CursorHold * call s:GetData()
  1901. <
  1902. Again, see |g:ycm_auto_hover| for proper hover support.
  1903. **NOTE**: The callback may be called immediately, in the stack frame that
  1904. called this function.
  1905. **NOTE**: Only one command request can be outstanding at once. Attempting to
  1906. request a second responses while the first is outstanding will result in the
  1907. second callback being immediately called with "''".
  1908. ===============================================================================
  1909. *youcompleteme-autocommands*
  1910. Autocommands ~
  1911. -------------------------------------------------------------------------------
  1912. The *YcmLocationOpened* autocommand
  1913. This 'User' autocommand is fired when YCM opens the location list window in
  1914. response to the 'YcmDiags' command. By default, the location list window is
  1915. opened to the bottom of the current window and its height is set to fit all
  1916. entries. This behavior can be overridden by using the |YcmLocationOpened|
  1917. autocommand which is triggered while the cursor is in the location list window.
  1918. For instance:
  1919. >
  1920. function! s:CustomizeYcmLocationWindow()
  1921. " Move the window to the top of the screen.
  1922. wincmd K
  1923. " Set the window height to 5.
  1924. 5wincmd _
  1925. " Switch back to working window.
  1926. wincmd p
  1927. endfunction
  1928. autocmd User YcmLocationOpened call s:CustomizeYcmLocationWindow()
  1929. <
  1930. -------------------------------------------------------------------------------
  1931. The *YcmQuickFixOpened* autocommand
  1932. This 'User' autocommand is fired when YCM opens the quickfix window in response
  1933. to the 'GoTo*' and 'RefactorRename' subcommands. By default, the quickfix
  1934. window is opened to full width at the bottom of the screen and its height is
  1935. set to fit all entries. This behavior can be overridden by using the
  1936. |YcmQuickFixOpened| autocommand which is triggered while the cursor is in the
  1937. quickfix window. For instance:
  1938. >
  1939. function! s:CustomizeYcmQuickFixWindow()
  1940. " Move the window to the top of the screen.
  1941. wincmd K
  1942. " Set the window height to 5.
  1943. 5wincmd _
  1944. endfunction
  1945. autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()
  1946. <
  1947. ===============================================================================
  1948. *youcompleteme-options*
  1949. Options ~
  1950. All options have reasonable defaults so if the plug-in works after installation
  1951. you don't need to change any options. These options can be configured in your
  1952. vimrc script [35] by including a line like this:
  1953. >
  1954. let g:ycm_min_num_of_chars_for_completion = 1
  1955. <
  1956. Note that after changing an option in your vimrc script [35] you have to
  1957. restart ycmd [42] with the |:YcmRestartServer| command for the changes to take
  1958. effect.
  1959. -------------------------------------------------------------------------------
  1960. The *g:ycm_min_num_of_chars_for_completion* option
  1961. This option controls the number of characters the user needs to type before
  1962. identifier-based completion suggestions are triggered. For example, if the
  1963. option is set to '2', then when the user types a second alphanumeric character
  1964. after a whitespace character, completion suggestions will be triggered. This
  1965. option is NOT used for semantic completion.
  1966. Setting this option to a high number like '99' effectively turns off the
  1967. identifier completion engine and just leaves the semantic engine.
  1968. Default: '2'
  1969. >
  1970. let g:ycm_min_num_of_chars_for_completion = 2
  1971. <
  1972. -------------------------------------------------------------------------------
  1973. The *g:ycm_min_num_identifier_candidate_chars* option
  1974. This option controls the minimum number of characters that a completion
  1975. candidate coming from the identifier completer must have to be shown in the
  1976. popup menu.
  1977. A special value of '0' means there is no limit.
  1978. **NOTE:** This option only applies to the identifier completer; it has no
  1979. effect on the various semantic completers.
  1980. Default: '0'
  1981. >
  1982. let g:ycm_min_num_identifier_candidate_chars = 0
  1983. <
  1984. -------------------------------------------------------------------------------
  1985. The *g:ycm_max_num_candidates* option
  1986. This option controls the maximum number of semantic completion suggestions
  1987. shown in the completion menu. This only applies to suggestions from semantic
  1988. completion engines; see the 'g:ycm_max_identifier_candidates' option to limit
  1989. the number of suggestions from the identifier-based engine.
  1990. A special value of '0' means there is no limit.
  1991. **NOTE:** Setting this option to '0' or to a value greater than '100' is not
  1992. recommended as it will slow down completion when there are a very large number
  1993. of suggestions.
  1994. Default: '50'
  1995. >
  1996. let g:ycm_max_num_candidates = 50
  1997. <
  1998. -------------------------------------------------------------------------------
  1999. The *g:ycm_max_num_candidates_to_detail* option
  2000. Some completion engines require completion candidates to be 'resolved' in order
  2001. to get detailed info such as inline documentation, method signatures etc. This
  2002. information is displayed by YCM in the preview window, or if 'completeopt'
  2003. contains 'popup', in the info popup next to the completion menu.
  2004. By deafult, if the info popup is in use, and there are more than 10 candidates,
  2005. YCM will defer resolving candidates until they are selected in the completion
  2006. menu. Otherwise, YCM must resolve the details upfront, which can be costly.
  2007. If neither 'popup' nor 'preview' are in 'completeopt', YCM disables resolving
  2008. altogether as the information would not be displayed.
  2009. This setting can be used to override these defaults and controls the number of
  2010. completion candidates that should be resolved upfront. Typically users do not
  2011. need to change this, as YCM will work out an appropriate value based on your
  2012. 'completeopt' and |g:ycm_add_preview_to_completeopt| settings. Howver, you may
  2013. override this calculation by setting this value to a number:
  2014. - '-1' - Resolve all candidates up front
  2015. - '0' - Never resolve any candidates up front.
  2016. - '> 0' - Resolve up to this many candidates up front. If the number of
  2017. candidates is greater than this value, no candidates are resolved.
  2018. In the later two cases, if 'completeopt' contains 'popup', then candidates are
  2019. resolved on demand asynchronously.
  2020. Default:
  2021. - '0' if neither 'popup' nor 'preview' are in 'completeopt'.
  2022. - '10' if 'popup' is in completeopt.
  2023. - '-1' if 'preview' is in completeopt.
  2024. Example:
  2025. >
  2026. let g:ycm_max_num_candidates_to_detail = 0
  2027. <
  2028. -------------------------------------------------------------------------------
  2029. The *g:ycm_max_num_identifier_candidates* option
  2030. This option controls the maximum number of completion suggestions from the
  2031. identifier-based engine shown in the completion menu.
  2032. A special value of '0' means there is no limit.
  2033. **NOTE:** Setting this option to '0' or to a value greater than '100' is not
  2034. recommended as it will slow down completion when there are a very large number
  2035. of suggestions.
  2036. Default: '10'
  2037. >
  2038. let g:ycm_max_num_identifier_candidates = 10
  2039. <
  2040. -------------------------------------------------------------------------------
  2041. The *g:ycm_auto_trigger* option
  2042. When set to '0', this option turns off YCM's identifier completer (the
  2043. as-you-type popup) _and_ the semantic triggers (the popup you'd get after
  2044. typing '.' or '->' in say C++). You can still force semantic completion with
  2045. the '<C-Space>' shortcut.
  2046. If you want to just turn off the identifier completer but keep the semantic
  2047. triggers, you should set |g:ycm_min_num_of_chars_for_completion| to a high
  2048. number like '99'.
  2049. Default: '1'
  2050. >
  2051. let g:ycm_auto_trigger = 1
  2052. <
  2053. -------------------------------------------------------------------------------
  2054. The *g:ycm_filetype_whitelist* option
  2055. This option controls for which Vim filetypes (see ':h filetype') should YCM be
  2056. turned on. The option value should be a Vim dictionary with keys being filetype
  2057. strings (like 'python', 'cpp', etc.) and values being unimportant (the
  2058. dictionary is used like a hash set, meaning that only the keys matter).
  2059. The '*' key is special and matches all filetypes. By default, the whitelist
  2060. contains only this '*' key.
  2061. YCM also has a |g:ycm_filetype_blacklist| option that lists filetypes for which
  2062. YCM shouldn't be turned on. YCM will work only in filetypes that both the
  2063. whitelist and the blacklist allow (the blacklist "allows" a filetype by _not_
  2064. having it as a key).
  2065. For example, let's assume you want YCM to work in files with the 'cpp'
  2066. filetype. The filetype should then be present in the whitelist either directly
  2067. ('cpp' key in the whitelist) or indirectly through the special '*' key. It
  2068. should _not_ be present in the blacklist.
  2069. Filetypes that are blocked by the either of the lists will be completely
  2070. ignored by YCM, meaning that neither the identifier-based completion engine nor
  2071. the semantic engine will operate in them.
  2072. You can get the filetype of the current file in Vim with ':set ft?'.
  2073. Default: "{'*': 1}"
  2074. >
  2075. let g:ycm_filetype_whitelist = {'*': 1}
  2076. <
  2077. -------------------------------------------------------------------------------
  2078. The *g:ycm_filetype_blacklist* option
  2079. This option controls for which Vim filetypes (see ':h filetype') should YCM be
  2080. turned off. The option value should be a Vim dictionary with keys being
  2081. filetype strings (like 'python', 'cpp', etc.) and values being unimportant (the
  2082. dictionary is used like a hash set, meaning that only the keys matter).
  2083. See the |g:ycm_filetype_whitelist| option for more details on how this works.
  2084. Default: '[see next line]'
  2085. >
  2086. let g:ycm_filetype_blacklist = {
  2087. \ 'tagbar': 1,
  2088. \ 'notes': 1,
  2089. \ 'markdown': 1,
  2090. \ 'netrw': 1,
  2091. \ 'unite': 1,
  2092. \ 'text': 1,
  2093. \ 'vimwiki': 1,
  2094. \ 'pandoc': 1,
  2095. \ 'infolog': 1,
  2096. \ 'leaderf': 1,
  2097. \ 'mail': 1
  2098. \}
  2099. <
  2100. -------------------------------------------------------------------------------
  2101. The *g:ycm_filetype_specific_completion_to_disable* option
  2102. This option controls for which Vim filetypes (see ':h filetype') should the YCM
  2103. semantic completion engine be turned off. The option value should be a Vim
  2104. dictionary with keys being filetype strings (like 'python', 'cpp', etc.) and
  2105. values being unimportant (the dictionary is used like a hash set, meaning that
  2106. only the keys matter). The listed filetypes will be ignored by the YCM semantic
  2107. completion engine, but the identifier-based completion engine will still
  2108. trigger in files of those filetypes.
  2109. Note that even if semantic completion is not turned off for a specific
  2110. filetype, you will not get semantic completion if the semantic engine does not
  2111. support that filetype.
  2112. You can get the filetype of the current file in Vim with ':set ft?'.
  2113. Default: '[see next line]'
  2114. >
  2115. let g:ycm_filetype_specific_completion_to_disable = {
  2116. \ 'gitcommit': 1
  2117. \}
  2118. <
  2119. -------------------------------------------------------------------------------
  2120. The *g:ycm_filepath_blacklist* option
  2121. This option controls for which Vim filetypes (see ':h filetype') should
  2122. filepath completion be disabled. The option value should be a Vim dictionary
  2123. with keys being filetype strings (like 'python', 'cpp', etc.) and values being
  2124. unimportant (the dictionary is used like a hash set, meaning that only the keys
  2125. matter).
  2126. The '*' key is special and matches all filetypes. Use this key if you want to
  2127. completely disable filepath completion:
  2128. >
  2129. let g:ycm_filepath_blacklist = {'*': 1}
  2130. <
  2131. You can get the filetype of the current file in Vim with ':set ft?'.
  2132. Default: '[see next line]'
  2133. >
  2134. let g:ycm_filepath_blacklist = {
  2135. \ 'html': 1,
  2136. \ 'jsx': 1,
  2137. \ 'xml': 1,
  2138. \}
  2139. <
  2140. -------------------------------------------------------------------------------
  2141. The *g:ycm_show_diagnostics_ui* option
  2142. When set, this option turns on YCM's diagnostic display features. See the
  2143. _Diagnostic display_ section in the _User Manual_ for more details.
  2144. Specific parts of the diagnostics UI (like the gutter signs, text highlighting,
  2145. diagnostic echo and auto location list population) can be individually turned
  2146. on or off. See the other options below for details.
  2147. Note that YCM's diagnostics UI is only supported for C-family languages.
  2148. When set, this option also makes YCM remove all Syntastic checkers set for the
  2149. 'c', 'cpp', 'objc', 'objcpp', and 'cuda' filetypes since this would conflict
  2150. with YCM's own diagnostics UI.
  2151. If you're using YCM's identifier completer in C-family languages but cannot use
  2152. the clang-based semantic completer for those languages _and_ want to use the
  2153. GCC Syntastic checkers, unset this option.
  2154. Default: '1'
  2155. >
  2156. let g:ycm_show_diagnostics_ui = 1
  2157. <
  2158. -------------------------------------------------------------------------------
  2159. The *g:ycm_error_symbol* option
  2160. YCM will use the value of this option as the symbol for errors in the Vim
  2161. gutter.
  2162. This option is part of the Syntastic compatibility layer; if the option is not
  2163. set, YCM will fall back to the value of the 'g:syntastic_error_symbol' option
  2164. before using this option's default.
  2165. Default: '>>'
  2166. >
  2167. let g:ycm_error_symbol = '>>'
  2168. <
  2169. -------------------------------------------------------------------------------
  2170. The *g:ycm_warning_symbol* option
  2171. YCM will use the value of this option as the symbol for warnings in the Vim
  2172. gutter.
  2173. This option is part of the Syntastic compatibility layer; if the option is not
  2174. set, YCM will fall back to the value of the 'g:syntastic_warning_symbol' option
  2175. before using this option's default.
  2176. Default: '>>'
  2177. >
  2178. let g:ycm_warning_symbol = '>>'
  2179. <
  2180. -------------------------------------------------------------------------------
  2181. The *g:ycm_enable_diagnostic_signs* option
  2182. When this option is set, YCM will put icons in Vim's gutter on lines that have
  2183. a diagnostic set. Turning this off will also turn off the 'YcmErrorLine' and
  2184. 'YcmWarningLine' highlighting.
  2185. This option is part of the Syntastic compatibility layer; if the option is not
  2186. set, YCM will fall back to the value of the 'g:syntastic_enable_signs' option
  2187. before using this option's default.
  2188. Default: '1'
  2189. >
  2190. let g:ycm_enable_diagnostic_signs = 1
  2191. <
  2192. -------------------------------------------------------------------------------
  2193. The *g:ycm_enable_diagnostic_highlighting* option
  2194. When this option is set, YCM will highlight regions of text that are related to
  2195. the diagnostic that is present on a line, if any.
  2196. This option is part of the Syntastic compatibility layer; if the option is not
  2197. set, YCM will fall back to the value of the 'g:syntastic_enable_highlighting'
  2198. option before using this option's default.
  2199. Default: '1'
  2200. >
  2201. let g:ycm_enable_diagnostic_highlighting = 1
  2202. <
  2203. -------------------------------------------------------------------------------
  2204. The *g:ycm_echo_current_diagnostic* option
  2205. When this option is set, YCM will echo the text of the diagnostic present on
  2206. the current line when you move your cursor to that line. If a |FixIt| is
  2207. available for the current diagnostic, then '(FixIt)' is appended.
  2208. This option is part of the Syntastic compatibility layer; if the option is not
  2209. set, YCM will fall back to the value of the 'g:syntastic_echo_current_error'
  2210. option before using this option's default.
  2211. Default: '1'
  2212. >
  2213. let g:ycm_echo_current_diagnostic = 1
  2214. <
  2215. -------------------------------------------------------------------------------
  2216. The *g:ycm_auto_hover* option
  2217. This option controls whether or not YCM shows documentation in a popup at the
  2218. cursor location after a short delay. Only supported in Vim.
  2219. When this option is set to "'CursorHold'", the popup is displayed on the
  2220. 'CursorHold' autocommand. See ':help CursorHold' for the details, but this
  2221. means that it is displayed after 'updatetime' milliseconds. When set to an
  2222. empty string, the popup is not automatically displayed.
  2223. In addition to this setting, there is the '<plug>(YCMHover)' mapping, which can
  2224. be used to manually trigger or hide the popup (it works like a toggle). For
  2225. example:
  2226. >
  2227. nmap <leader>D <plug>(YCMHover)
  2228. <
  2229. After dismissing the popup with this mapping, it will not be automatically
  2230. triggered again until the cursor is moved (i.e. 'CursorMoved' autocommand).
  2231. The displayed documentation depends on what the completer for the current
  2232. language supports. It's selected heuristically in this order of preference:
  2233. 1. 'GetHover' with 'markdown' syntax
  2234. 2. |GetDoc| with no syntax
  2235. 3. |GetType| with the syntax of the current file.
  2236. You can customise this by manually setting up 'b:ycm_hover' to your liking.
  2237. This buffer-local variable can be set to a dictionary with the following keys:
  2238. - 'command': The YCM completer subcommand which should be run on hover
  2239. - 'syntax': The syntax to use (as in 'set syntax=') in the popup window for
  2240. highlighting.
  2241. For example, to use C/C++ syntax highlighting in the popup for C-family
  2242. languages, add something like this to your vimrc:
  2243. >
  2244. augroup MyYCMCustom
  2245. autocmd!
  2246. autocmd FileType c,cpp let b:ycm_hover = {
  2247. \ 'command': 'GetDoc',
  2248. \ 'syntax': &filetype
  2249. \ }
  2250. augroup END
  2251. <
  2252. Default: "'CursorHold'"
  2253. -------------------------------------------------------------------------------
  2254. The *g:ycm_filter_diagnostics* option
  2255. This option controls which diagnostics will be rendered by YCM. This option
  2256. holds a dictionary of key-values, where the keys are Vim's filetype strings
  2257. delimited by commas and values are dictionaries describing the filter.
  2258. A filter is a dictionary of key-values, where the keys are the type of filter,
  2259. and the value is a list of arguments to that filter. In the case of just a
  2260. single item in the list, you may omit the brackets and just provide the
  2261. argument directly. If any filter matches a diagnostic, it will be dropped and
  2262. YCM will not render it.
  2263. The following filter types are supported:
  2264. - "regex": Accepts a string regular expression [75]. This type matches when
  2265. the regex (treated as case-insensitive) is found anywhere in the diagnostic
  2266. text ('re.search', not 're.match')
  2267. - "level": Accepts a string level, either "warning" or "error." This type
  2268. matches when the diagnostic has the same level, that is, specifying 'level:
  2269. "error"' will remove **all** errors from the diagnostics.
  2270. **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [75].
  2271. Default: '{}'
  2272. The following example will do, for java filetype only: - Remove **all** error
  2273. level diagnostics, and, - Also remove anything that contains 'ta<something>co'
  2274. >
  2275. let g:ycm_filter_diagnostics = {
  2276. \ "java": {
  2277. \ "regex": [ "ta.+co", ... ],
  2278. \ "level": "error",
  2279. \ ...
  2280. \ }
  2281. \ }
  2282. <
  2283. -------------------------------------------------------------------------------
  2284. The *g:ycm_always_populate_location_list* option
  2285. When this option is set, YCM will populate the location list automatically
  2286. every time it gets new diagnostic data. This option is off by default so as not
  2287. to interfere with other data you might have placed in the location list.
  2288. See ':help location-list' in Vim to learn more about the location list.
  2289. This option is part of the Syntastic compatibility layer; if the option is not
  2290. set, YCM will fall back to the value of the
  2291. 'g:syntastic_always_populate_loc_list' option before using this option's
  2292. default.
  2293. Default: '0'
  2294. >
  2295. let g:ycm_always_populate_location_list = 0
  2296. <
  2297. -------------------------------------------------------------------------------
  2298. The *g:ycm_open_loclist_on_ycm_diags* option
  2299. When this option is set, |:YcmDiags| will automatically open the location list
  2300. after forcing a compilation and filling the list with diagnostic data.
  2301. See ':help location-list' in Vim to learn more about the location list.
  2302. Default: '1'
  2303. >
  2304. let g:ycm_open_loclist_on_ycm_diags = 1
  2305. <
  2306. -------------------------------------------------------------------------------
  2307. The *g:ycm_complete_in_comments* option
  2308. When this option is set to '1', YCM will show the completion menu even when
  2309. typing inside comments.
  2310. Default: '0'
  2311. >
  2312. let g:ycm_complete_in_comments = 0
  2313. <
  2314. -------------------------------------------------------------------------------
  2315. The *g:ycm_complete_in_strings* option
  2316. When this option is set to '1', YCM will show the completion menu even when
  2317. typing inside strings.
  2318. Note that this is turned on by default so that you can use the filename
  2319. completion inside strings. This is very useful for instance in C-family files
  2320. where typing '#include "' will trigger the start of filename completion. If you
  2321. turn off this option, you will turn off filename completion in such situations
  2322. as well.
  2323. Default: '1'
  2324. >
  2325. let g:ycm_complete_in_strings = 1
  2326. <
  2327. -------------------------------------------------------------------------------
  2328. The *g:ycm_collect_identifiers_from_comments_and_strings* option
  2329. When this option is set to '1', YCM's identifier completer will also collect
  2330. identifiers from strings and comments. Otherwise, the text in comments and
  2331. strings will be ignored.
  2332. Default: '0'
  2333. >
  2334. let g:ycm_collect_identifiers_from_comments_and_strings = 0
  2335. <
  2336. -------------------------------------------------------------------------------
  2337. The *g:ycm_collect_identifiers_from_tags_files* option
  2338. When this option is set to '1', YCM's identifier completer will also collect
  2339. identifiers from tags files. The list of tags files to examine is retrieved
  2340. from the 'tagfiles()' Vim function which examines the 'tags' Vim option. See
  2341. ":h 'tags'" for details.
  2342. YCM will re-index your tags files if it detects that they have been modified.
  2343. The only supported tag format is the Exuberant Ctags format [76]. The format
  2344. from "plain" ctags is NOT supported. Ctags needs to be called with the
  2345. '--fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the
  2346. 'language:<lang>' field in the tags output.
  2347. See the _FAQ_ for pointers if YCM does not appear to read your tag files.
  2348. This option is off by default because it makes Vim slower if your tags are on a
  2349. network directory.
  2350. Default: '0'
  2351. >
  2352. let g:ycm_collect_identifiers_from_tags_files = 0
  2353. <
  2354. -------------------------------------------------------------------------------
  2355. The *g:ycm_seed_identifiers_with_syntax* option
  2356. When this option is set to '1', YCM's identifier completer will seed its
  2357. identifier database with the keywords of the programming language you're
  2358. writing.
  2359. Since the keywords are extracted from the Vim syntax file for the filetype, all
  2360. keywords may not be collected, depending on how the syntax file was written.
  2361. Usually at least 95% of the keywords are successfully extracted.
  2362. Default: '0'
  2363. >
  2364. let g:ycm_seed_identifiers_with_syntax = 0
  2365. <
  2366. -------------------------------------------------------------------------------
  2367. The *g:ycm_extra_conf_vim_data* option
  2368. If you're using semantic completion for C-family files, this option might come
  2369. handy; it's a way of sending data from Vim to your 'Settings' function in your
  2370. '.ycm_extra_conf.py' file.
  2371. This option is supposed to be a list of VimScript expression strings that are
  2372. evaluated for every request to the ycmd server [42] and then passed to your
  2373. 'Settings' function as a 'client_data' keyword argument.
  2374. For instance, if you set this option to "['v:version']", your 'Settings'
  2375. function will be called like this:
  2376. >
  2377. # The '801' value is of course contingent on Vim 8.1; in 8.0 it would be '800'
  2378. Settings( ..., client_data = { 'v:version': 801 } )
  2379. <
  2380. So the 'client_data' parameter is a dictionary mapping Vim expression strings
  2381. to their values at the time of the request.
  2382. The correct way to define parameters for your 'Settings' function:
  2383. >
  2384. def Settings( **kwargs ):
  2385. <
  2386. You can then get to 'client_data' with "kwargs['client_data']".
  2387. Default: '[]'
  2388. >
  2389. let g:ycm_extra_conf_vim_data = []
  2390. <
  2391. -------------------------------------------------------------------------------
  2392. The *g:ycm_server_python_interpreter* option
  2393. YCM will by default search for an appropriate Python interpreter on your
  2394. system. You can use this option to override that behavior and force the use of
  2395. a specific interpreter of your choosing.
  2396. **NOTE:** This interpreter is only used for the ycmd server [42]. The YCM
  2397. client running inside Vim always uses the Python interpreter that's embedded
  2398. inside Vim.
  2399. Default: "''"
  2400. >
  2401. let g:ycm_server_python_interpreter = ''
  2402. <
  2403. -------------------------------------------------------------------------------
  2404. The *g:ycm_keep_logfiles* option
  2405. When this option is set to '1', YCM and the ycmd completion server [42] will
  2406. keep the logfiles around after shutting down (they are deleted on shutdown by
  2407. default).
  2408. To see where the logfiles are, call |:YcmDebugInfo|.
  2409. Default: '0'
  2410. >
  2411. let g:ycm_keep_logfiles = 0
  2412. <
  2413. -------------------------------------------------------------------------------
  2414. The *g:ycm_log_level* option
  2415. The logging level that YCM and the ycmd completion server [42] use. Valid
  2416. values are the following, from most verbose to least verbose: - 'debug' -
  2417. 'info' - 'warning' - 'error' - 'critical'
  2418. Note that 'debug' is _very_ verbose.
  2419. Default: 'info'
  2420. >
  2421. let g:ycm_log_level = 'info'
  2422. <
  2423. -------------------------------------------------------------------------------
  2424. The *g:ycm_auto_start_csharp_server* option
  2425. When set to '1', the OmniSharp-Roslyn server will be automatically started
  2426. (once per Vim session) when you open a C# file.
  2427. Default: '1'
  2428. >
  2429. let g:ycm_auto_start_csharp_server = 1
  2430. <
  2431. -------------------------------------------------------------------------------
  2432. The *g:ycm_auto_stop_csharp_server* option
  2433. When set to '1', the OmniSharp-Roslyn server will be automatically stopped upon
  2434. closing Vim.
  2435. Default: '1'
  2436. >
  2437. let g:ycm_auto_stop_csharp_server = 1
  2438. <
  2439. -------------------------------------------------------------------------------
  2440. The *g:ycm_csharp_server_port* option
  2441. When g:ycm_auto_start_csharp_server is set to '1', specifies the port for the
  2442. OmniSharp-Roslyn server to listen on. When set to '0' uses an unused port
  2443. provided by the OS.
  2444. Default: '0'
  2445. >
  2446. let g:ycm_csharp_server_port = 0
  2447. <
  2448. -------------------------------------------------------------------------------
  2449. The *g:ycm_csharp_insert_namespace_expr* option
  2450. By default, when YCM inserts a namespace, it will insert the 'using' statement
  2451. under the nearest 'using' statement. You may prefer that the 'using' statement
  2452. is inserted somewhere, for example, to preserve sorting. If so, you can set
  2453. this option to override this behavior.
  2454. When this option is set, instead of inserting the 'using' statement itself, YCM
  2455. will set the global variable 'g:ycm_namespace_to_insert' to the namespace to
  2456. insert, and then evaluate this option's value as an expression. The option's
  2457. expression is responsible for inserting the namespace - the default insertion
  2458. will not occur.
  2459. Default: ''
  2460. >
  2461. let g:ycm_csharp_insert_namespace_expr = ''
  2462. <
  2463. -------------------------------------------------------------------------------
  2464. The *g:ycm_add_preview_to_completeopt* option
  2465. When this option is set to '1', YCM will add the 'preview' string to Vim's
  2466. 'completeopt' option (see ':h completeopt'). If your 'completeopt' option
  2467. already has 'preview' set, there will be no effect. Alternatively, when set to
  2468. 'popup' and your version of Vim supports popup windows (see ':help popup'), the
  2469. 'popup' string will be used instead. You can see the current state of your
  2470. 'completeopt' setting with ':set completeopt?' (yes, the question mark is
  2471. important).
  2472. When 'preview' is present in 'completeopt', YCM will use the 'preview' window
  2473. at the top of the file to store detailed information about the current
  2474. completion candidate (but only if the candidate came from the semantic engine).
  2475. For instance, it would show the full function prototype and all the function
  2476. overloads in the window if the current completion is a function name.
  2477. When 'popup' is present in 'completeopt', YCM will instead use a 'popup' window
  2478. to the side of the completion popup for storing detailed information about the
  2479. current completion candidate. In addition, YCM may truncate the detailed
  2480. completion information in order to give the popup sufficient room to display
  2481. that detailed information.
  2482. Default: '0'
  2483. >
  2484. let g:ycm_add_preview_to_completeopt = 0
  2485. <
  2486. -------------------------------------------------------------------------------
  2487. The *g:ycm_autoclose_preview_window_after_completion* option
  2488. When this option is set to '1', YCM will auto-close the 'preview' window after
  2489. the user accepts the offered completion string. If there is no 'preview' window
  2490. triggered because there is no 'preview' string in 'completeopt', this option is
  2491. irrelevant. See the |g:ycm_add_preview_to_completeopt| option for more details.
  2492. Default: '0'
  2493. >
  2494. let g:ycm_autoclose_preview_window_after_completion = 0
  2495. <
  2496. -------------------------------------------------------------------------------
  2497. The *g:ycm_autoclose_preview_window_after_insertion* option
  2498. When this option is set to '1', YCM will auto-close the 'preview' window after
  2499. the user leaves insert mode. This option is irrelevant if
  2500. |g:ycm_autoclose_preview_window_after_completion| is set or if no 'preview'
  2501. window is triggered. See the |g:ycm_add_preview_to_completeopt| option for more
  2502. details.
  2503. Default: '0'
  2504. >
  2505. let g:ycm_autoclose_preview_window_after_insertion = 0
  2506. <
  2507. -------------------------------------------------------------------------------
  2508. The *g:ycm_max_diagnostics_to_display* option
  2509. This option controls the maximum number of diagnostics shown to the user when
  2510. errors or warnings are detected in the file. This option is only relevant for
  2511. the C-family, C#, Java, JavaScript, and TypeScript languages.
  2512. A special value of '0' means there is no limit.
  2513. Default: '30'
  2514. >
  2515. let g:ycm_max_diagnostics_to_display = 30
  2516. <
  2517. -------------------------------------------------------------------------------
  2518. The *g:ycm_key_list_select_completion* option
  2519. This option controls the key mappings used to select the first completion
  2520. string. Invoking any of them repeatedly cycles forward through the completion
  2521. list.
  2522. Some users like adding '<Enter>' to this list.
  2523. Default: "['<TAB>', '<Down>']"
  2524. >
  2525. let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
  2526. <
  2527. -------------------------------------------------------------------------------
  2528. The *g:ycm_key_list_previous_completion* option
  2529. This option controls the key mappings used to select the previous completion
  2530. string. Invoking any of them repeatedly cycles backwards through the completion
  2531. list.
  2532. Note that one of the defaults is '<S-TAB>' which means Shift-TAB. That mapping
  2533. will probably only work in GUI Vim (Gvim or MacVim) and not in plain console
  2534. Vim because the terminal usually does not forward modifier key combinations to
  2535. Vim.
  2536. Default: "['<S-TAB>', '<Up>']"
  2537. >
  2538. let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']
  2539. <
  2540. -------------------------------------------------------------------------------
  2541. The *g:ycm_key_list_stop_completion* option
  2542. This option controls the key mappings used to close the completion menu. This
  2543. is useful when the menu is blocking the view, when you need to insert the
  2544. '<TAB>' character, or when you want to expand a snippet from UltiSnips [24] and
  2545. navigate through it.
  2546. Default: "['<C-y>']"
  2547. >
  2548. let g:ycm_key_list_stop_completion = ['<C-y>']
  2549. <
  2550. -------------------------------------------------------------------------------
  2551. The *g:ycm_key_invoke_completion* option
  2552. This option controls the key mapping used to invoke the completion menu for
  2553. semantic completion. By default, semantic completion is triggered automatically
  2554. after typing '.', '->' and '::' in insert mode (if semantic completion support
  2555. has been compiled in). This key mapping can be used to trigger semantic
  2556. completion anywhere. Useful for searching for top-level functions and classes.
  2557. Console Vim (not Gvim or MacVim) passes '<Nul>' to Vim when the user types
  2558. '<C-Space>' so YCM will make sure that '<Nul>' is used in the map command when
  2559. you're editing in console Vim, and '<C-Space>' in GUI Vim. This means that you
  2560. can just press '<C-Space>' in both console and GUI Vim and YCM will do the
  2561. right thing.
  2562. Setting this option to an empty string will make sure no mapping is created.
  2563. Default: '<C-Space>'
  2564. >
  2565. let g:ycm_key_invoke_completion = '<C-Space>'
  2566. <
  2567. -------------------------------------------------------------------------------
  2568. The *g:ycm_key_detailed_diagnostics* option
  2569. This option controls the key mapping used to show the full diagnostic text when
  2570. the user's cursor is on the line with the diagnostic. It basically calls
  2571. |:YcmShowDetailedDiagnostic|.
  2572. Setting this option to an empty string will make sure no mapping is created.
  2573. Default: '<leader>d'
  2574. >
  2575. let g:ycm_key_detailed_diagnostics = '<leader>d'
  2576. <
  2577. -------------------------------------------------------------------------------
  2578. The *g:ycm_global_ycm_extra_conf* option
  2579. Normally, YCM searches for a '.ycm_extra_conf.py' file for compilation flags
  2580. (see the User Guide for more details on how this works). This option specifies
  2581. a fallback path to a config file which is used if no '.ycm_extra_conf.py' is
  2582. found.
  2583. You can place such a global file anywhere in your filesystem.
  2584. Default: "''"
  2585. >
  2586. let g:ycm_global_ycm_extra_conf = ''
  2587. <
  2588. -------------------------------------------------------------------------------
  2589. The *g:ycm_confirm_extra_conf* option
  2590. When this option is set to '1' YCM will ask once per '.ycm_extra_conf.py' file
  2591. if it is safe to be loaded. This is to prevent execution of malicious code from
  2592. a '.ycm_extra_conf.py' file you didn't write.
  2593. To selectively get YCM to ask/not ask about loading certain
  2594. '.ycm_extra_conf.py' files, see the |g:ycm_extra_conf_globlist| option.
  2595. Default: '1'
  2596. >
  2597. let g:ycm_confirm_extra_conf = 1
  2598. <
  2599. -------------------------------------------------------------------------------
  2600. The *g:ycm_extra_conf_globlist* option
  2601. This option is a list that may contain several globbing patterns. If a pattern
  2602. starts with a '!' all '.ycm_extra_conf.py' files matching that pattern will be
  2603. blacklisted, that is they won't be loaded and no confirmation dialog will be
  2604. shown. If a pattern does not start with a '!' all files matching that pattern
  2605. will be whitelisted. Note that this option is not used when confirmation is
  2606. disabled using |g:ycm_confirm_extra_conf| and that items earlier in the list
  2607. will take precedence over the later ones.
  2608. Rules:
  2609. - '*' matches everything
  2610. - '?' matches any single character
  2611. - '[seq]' matches any character in seq
  2612. - '[!seq]' matches any char not in seq
  2613. Example:
  2614. >
  2615. let g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']
  2616. <
  2617. - The first rule will match everything contained in the '~/dev' directory so
  2618. '.ycm_extra_conf.py' files from there will be loaded.
  2619. - The second rule will match everything in the home directory so a
  2620. '.ycm_extra_conf.py' file from there won't be loaded.
  2621. - As the first rule takes precedence everything in the home directory
  2622. excluding the '~/dev' directory will be blacklisted.
  2623. **NOTE:** The glob pattern is first expanded with Python's
  2624. 'os.path.expanduser()' and then resolved with 'os.path.abspath()' before being
  2625. matched against the filename.
  2626. Default: '[]'
  2627. >
  2628. let g:ycm_extra_conf_globlist = []
  2629. <
  2630. -------------------------------------------------------------------------------
  2631. The *g:ycm_filepath_completion_use_working_dir* option
  2632. By default, YCM's filepath completion will interpret relative paths like '../'
  2633. as being relative to the folder of the file of the currently active buffer.
  2634. Setting this option will force YCM to always interpret relative paths as being
  2635. relative to Vim's current working directory.
  2636. Default: '0'
  2637. >
  2638. let g:ycm_filepath_completion_use_working_dir = 0
  2639. <
  2640. -------------------------------------------------------------------------------
  2641. The *g:ycm_semantic_triggers* option
  2642. This option controls the character-based triggers for the various semantic
  2643. completion engines. The option holds a dictionary of key-values, where the keys
  2644. are Vim's filetype strings delimited by commas and values are lists of strings,
  2645. where the strings are the triggers.
  2646. Setting key-value pairs on the dictionary _adds_ semantic triggers to the
  2647. internal default set (listed below). You cannot remove the default triggers,
  2648. only add new ones.
  2649. A "trigger" is a sequence of one or more characters that trigger semantic
  2650. completion when typed. For instance, C++ ('cpp' filetype) has '.' listed as a
  2651. trigger. So when the user types 'foo.', the semantic engine will trigger and
  2652. serve 'foo''s list of member functions and variables. Since C++ also has '->'
  2653. listed as a trigger, the same thing would happen when the user typed 'foo->'.
  2654. It's also possible to use a regular expression as a trigger. You have to prefix
  2655. your trigger with 're!' to signify it's a regex trigger. For instance,
  2656. 're!\w+\.' would only trigger after the '\w+\.' regex matches.
  2657. **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [75].
  2658. Default: '[see next line]'
  2659. >
  2660. let g:ycm_semantic_triggers = {
  2661. \ 'c': ['->', '.'],
  2662. \ 'objc': ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
  2663. \ 're!\[.*\]\s'],
  2664. \ 'ocaml': ['.', '#'],
  2665. \ 'cpp,cuda,objcpp': ['->', '.', '::'],
  2666. \ 'perl': ['->'],
  2667. \ 'php': ['->', '::'],
  2668. \ 'cs,d,elixir,go,groovy,java,javascript,julia,perl6,python,scala,typescript,vb': ['.'],
  2669. \ 'ruby,rust': ['.', '::'],
  2670. \ 'lua': ['.', ':'],
  2671. \ 'erlang': [':'],
  2672. \ }
  2673. <
  2674. -------------------------------------------------------------------------------
  2675. The *g:ycm_cache_omnifunc* option
  2676. Some omnicompletion engines do not work well with the YCM cache—in particular,
  2677. they might not produce all possible results for a given prefix. By unsetting
  2678. this option you can ensure that the omnicompletion engine is re-queried on
  2679. every keypress. That will ensure all completions will be presented, but might
  2680. cause stuttering and lagginess if the omnifunc is slow.
  2681. Default: '1'
  2682. >
  2683. let g:ycm_cache_omnifunc = 1
  2684. <
  2685. -------------------------------------------------------------------------------
  2686. The *g:ycm_use_ultisnips_completer* option
  2687. By default, YCM will query the UltiSnips plugin for possible completions of
  2688. snippet triggers. This option can turn that behavior off.
  2689. Default: '1'
  2690. >
  2691. let g:ycm_use_ultisnips_completer = 1
  2692. <
  2693. -------------------------------------------------------------------------------
  2694. The *g:ycm_goto_buffer_command* option
  2695. Defines where 'GoTo*' commands result should be opened. Can take one of the
  2696. following values: "'same-buffer'", "'split'", or "'split-or-existing-window'".
  2697. If this option is set to the "'same-buffer'" but current buffer can not be
  2698. switched (when buffer is modified and 'nohidden' option is set), then result
  2699. will be opened in a split. When the option is set to
  2700. "'split-or-existing-window'", if the result is already open in a window of the
  2701. current tab page (or any tab pages with the ':tab' modifier; see below), it
  2702. will jump to that window. Otherwise, the result will be opened in a split as if
  2703. the option was set to "'split'".
  2704. To customize the way a new window is split, prefix the 'GoTo*' command with one
  2705. of the following modifiers: ':aboveleft', ':belowright', ':botright',
  2706. ':leftabove', ':rightbelow', ':topleft', and ':vertical'. For instance, to
  2707. split vertically to the right of the current window, run the command:
  2708. >
  2709. :rightbelow vertical YcmCompleter GoTo
  2710. <
  2711. To open in a new tab page, use the ':tab' modifier with the "'split'" or
  2712. "'split-or-existing-window'" options e.g.:
  2713. >
  2714. :tab YcmCompleter GoTo
  2715. <
  2716. **NOTE:** command modifiers were added in Vim 7.4.1898. If you are using an
  2717. older version, you can still configure this by setting the option to one of the
  2718. deprecated values: "'vertical-split'", "'new-tab'", or "'new-or-existing-tab'".
  2719. Default: "'same-buffer'"
  2720. >
  2721. let g:ycm_goto_buffer_command = 'same-buffer'
  2722. <
  2723. -------------------------------------------------------------------------------
  2724. The *g:ycm_disable_for_files_larger_than_kb* option
  2725. Defines the max size (in Kb) for a file to be considered for completion. If
  2726. this option is set to 0 then no check is made on the size of the file you're
  2727. opening.
  2728. Default: 1000
  2729. >
  2730. let g:ycm_disable_for_files_larger_than_kb = 1000
  2731. <
  2732. -------------------------------------------------------------------------------
  2733. The *g:ycm_use_clangd* option
  2734. This option controls whether **clangd** should be used as completion engine for
  2735. C-family languages. Can take one of the following values: '1', '0', with
  2736. meanings:
  2737. - '1': YCM will use clangd if clangd binary exists in third party or it was
  2738. provided with 'ycm_clangd_binary_path' option.
  2739. - '0': YCM will never use clangd completer.
  2740. Default: '1'
  2741. >
  2742. let g:ycm_use_clangd = 1
  2743. <
  2744. -------------------------------------------------------------------------------
  2745. The *g:ycm_clangd_binary_path* option
  2746. When 'ycm_use_clangd' option is set to '1', this option sets the path to
  2747. **clangd** binary.
  2748. Default: "''"
  2749. >
  2750. let g:ycm_clangd_binary_path = ''
  2751. <
  2752. -------------------------------------------------------------------------------
  2753. The *g:ycm_clangd_args* option
  2754. This option controls the command line arguments passed to the clangd binary. It
  2755. appends new options and overrides the existing ones.
  2756. Default: '[]'
  2757. >
  2758. let g:ycm_clangd_args = []
  2759. <
  2760. -------------------------------------------------------------------------------
  2761. The *g:ycm_clangd_uses_ycmd_caching* option
  2762. This option controls which ranking and filtering algorithm to use for
  2763. completion items. It can take values:
  2764. - '1': Uses ycmd's caching and filtering logic.
  2765. - '0': Uses clangd's caching and filtering logic.
  2766. Default: '1'
  2767. >
  2768. let g:ycm_clangd_uses_ycmd_caching = 1
  2769. <
  2770. -------------------------------------------------------------------------------
  2771. The *g:ycm_language_server* option
  2772. This option lets YCM use an arbitrary LSP server, not unlike coc.nvim and
  2773. others. However, the officially supported completers are favoured over custom
  2774. LSP ones, so overriding an existing completer means first making sure YCM won't
  2775. choose that existing completer in the first place.
  2776. A simple working example of this option can be found in the section called
  2777. "Semantic Completion for Other Languages".
  2778. Default: '[]'
  2779. >
  2780. let g:ycm_language_server = []
  2781. <
  2782. -------------------------------------------------------------------------------
  2783. The *g:ycm_disable_signature_help* option
  2784. This option allows you to disable all signature help for all completion
  2785. engines. There is no way to disable it per-completer. This option is
  2786. _reserved_, meaning that while signature help support remains experimental, its
  2787. values and meaning may change and it may be removed in a future version.
  2788. Default: '0'
  2789. >
  2790. " Disable signature help
  2791. let g:ycm_disable_signature_help = 1
  2792. <
  2793. -------------------------------------------------------------------------------
  2794. The *g:ycm_gopls_binary_path* option
  2795. In case the system-wide 'gopls' binary is newer than the bundled one, setting
  2796. this option to the path of the system-wide 'gopls' would make YCM use that one
  2797. instead.
  2798. If the path is just 'gopls', YCM will search in '$PATH'.
  2799. -------------------------------------------------------------------------------
  2800. The *g:ycm_gopls_args* option
  2801. Similar to the |g:ycm_clangd_args|, this option allows passing additional flags
  2802. to the 'gopls' command line.
  2803. Default: '[]'
  2804. >
  2805. let g:ycm_gopls_args = []
  2806. <
  2807. -------------------------------------------------------------------------------
  2808. The *g:ycm_rls_binary_path* and 'g:ycm_rustc_binary_path' options
  2809. YCM no longer uses RLS for rust, and these options are therefore no longer
  2810. supported.
  2811. To use a custom rust-analyzer, see |g:ycm_rust_toolchain_root|.
  2812. -------------------------------------------------------------------------------
  2813. The *g:ycm_rust_toolchain_root* option
  2814. Optionally specify the path to a custom rust toolchain including at least a
  2815. supported version of 'rust-analyzer'.
  2816. -------------------------------------------------------------------------------
  2817. The *g:ycm_tsserver_binary_path* option
  2818. Similar to the 'gopls' path, this option tells YCM where is the TSServer
  2819. executable located.
  2820. -------------------------------------------------------------------------------
  2821. The *g:ycm_roslyn_binary_path* option
  2822. Similar to the 'gopls' path, this option tells YCM where is the
  2823. Omnisharp-Roslyn executable located.
  2824. ===============================================================================
  2825. *youcompleteme-faq*
  2826. FAQ ~
  2827. The FAQ section has been moved to the wiki [8].
  2828. ===============================================================================
  2829. *youcompleteme-contributor-code-of-conduct*
  2830. Contributor Code of Conduct ~
  2831. Please note that this project is released with a Contributor Code of Conduct
  2832. [77]. By participating in this project you agree to abide by its terms.
  2833. ===============================================================================
  2834. *youcompleteme-contact*
  2835. Contact ~
  2836. If you have questions about the plugin or need help, please join the Gitter
  2837. room [1] or use the ycm-users [78] mailing list.
  2838. If you have bug reports or feature suggestions, please use the issue tracker
  2839. [79]. Before you do, please carefully read CONTRIBUTING.md [80] as this asks
  2840. for important diagnostics which the team will use to help get you going.
  2841. The latest version of the plugin is available at
  2842. https://ycm-core.github.io/YouCompleteMe/.
  2843. The author's homepage is https://val.markovic.io.
  2844. Please do **NOT** go to #vim on freenode for support. Please contact the
  2845. YouCompleteMe maintainers directly using the contact details.
  2846. ===============================================================================
  2847. *youcompleteme-license*
  2848. License ~
  2849. This software is licensed under the GPL v3 license [81]. © 2015-2018
  2850. YouCompleteMe contributors
  2851. ===============================================================================
  2852. *youcompleteme-references*
  2853. References ~
  2854. [1] https://gitter.im/Valloric/YouCompleteMe
  2855. [2] https://img.shields.io/gitter/room/Valloric/YouCompleteMe.svg
  2856. [3] https://dev.azure.com/YouCompleteMe/YCM/_build?definitionId=3&branchName=master
  2857. [4] https://dev.azure.com/YouCompleteMe/YCM/_apis/build/status/ycm-core.YouCompleteMe?branchName=master
  2858. [5] https://codecov.io/gh/ycm-core/YouCompleteMe
  2859. [6] https://img.shields.io/codecov/c/github/ycm-core/YouCompleteMe/master.svg
  2860. [7] https://github.com/ycm-core/YouCompleteMe/wiki/Troubleshooting-steps-for-ycmd-server-SHUT-DOWN
  2861. [8] https://github.com/ycm-core/YouCompleteMe/wiki/FAQ
  2862. [9] https://www.vim.org/
  2863. [10] https://clang.llvm.org/extra/clangd.html
  2864. [11] https://github.com/davidhalter/jedi
  2865. [12] https://github.com/OmniSharp/omnisharp-roslyn
  2866. [13] https://github.com/golang/go/wiki/gopls
  2867. [14] https://github.com/Microsoft/TypeScript/tree/master/src/server
  2868. [15] https://rust-analyzer.github.io
  2869. [16] https://github.com/eclipse/eclipse.jdt.ls
  2870. [17] https://i.imgur.com/0OP4ood.gif
  2871. [18] https://en.wikipedia.org/wiki/Subsequence
  2872. [19] https://github.com/scrooloose/syntastic
  2873. [20] https://user-images.githubusercontent.com/10026824/34471853-af9cf32a-ef53-11e7-8229-de534058ddc4.gif
  2874. [21] https://user-images.githubusercontent.com/10584846/58738348-5060da80-83fd-11e9-9537-d07fdbf4554c.gif
  2875. [22] https://i.imgur.com/nmUUbdl.gif
  2876. [23] https://user-images.githubusercontent.com/10584846/80312146-91af6500-87db-11ea-996b-7396f3134d1f.gif
  2877. [24] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
  2878. [25] https://github.com/VundleVim/Vundle.vim#about
  2879. [26] https://macvim-dev.github.io/macvim/
  2880. [27] https://brew.sh
  2881. [28] https://www.mono-project.com/docs/getting-started/install/mac/
  2882. [29] https://golang.org/doc/install
  2883. [30] https://docs.npmjs.com/getting-started/installing-node#1-install-nodejs--npm
  2884. [31] https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2885. [32] https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source
  2886. [33] https://www.mono-project.com/download/stable/#download-lin
  2887. [34] https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15
  2888. [35] https://vimhelp.appspot.com/starting.txt.html#vimrc
  2889. [36] https://github.com/vim/vim-win32-installer/releases
  2890. [37] https://www.python.org/downloads/windows/
  2891. [38] https://cmake.org/download/
  2892. [39] https://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1
  2893. [40] https://github.com/ycm-core/YouCompleteMe/wiki/Full-Installation-Guide
  2894. [41] https://www.unicode.org/glossary/#diacritic
  2895. [42] https://github.com/ycm-core/ycmd
  2896. [43] https://github.com/ycm-core/ycmd/pull/1255
  2897. [44] https://github.com/ycm-core/YouCompleteMe/wiki/C-family-Semantic-Completion-through-libclang
  2898. [45] https://clang.llvm.org/docs/JSONCompilationDatabase.html
  2899. [46] https://ninja-build.org/manual.html
  2900. [47] https://pypi.org/project/compiledb/
  2901. [48] https://github.com/rizsotto/Bear
  2902. [49] https://raw.githubusercontent.com/ycm-core/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py
  2903. [50] https://github.com/rdnetto/YCM-Generator
  2904. [51] https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
  2905. [52] https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html
  2906. [53] https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
  2907. [54] https://docs.gradle.org/current/userguide/tutorial_java_projects.html
  2908. [55] https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html
  2909. [56] https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_eclipse_project
  2910. [57] https://github.com/ycm-core/ycmd/blob/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_maven_project/pom.xml
  2911. [58] https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_gradle_project
  2912. [59] https://github.com/ycm-core/YouCompleteMe/blob/master/.ycm_extra_conf.py
  2913. [60] https://github.com/rust-lang/rls
  2914. [61] https://www.rust-lang.org/downloads.html
  2915. [62] https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs
  2916. [63] https://github.com/golang/tools/blob/master/internal/lsp/server.go
  2917. [64] https://ternjs.net
  2918. [65] https://github.com/ycm-core/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern
  2919. [66] https://code.visualstudio.com/docs/languages/jsconfig
  2920. [67] https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
  2921. [68] https://clang.llvm.org/
  2922. [69] https://github.com/ycm-core/lsp-examples
  2923. [70] http://eclim.org/
  2924. [71] https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/completer.py
  2925. [72] https://github.com/Valloric/ListToggle
  2926. [73] https://github.com/puremourning/vimspector
  2927. [74] https://github.com/itchyny/lightline.vim
  2928. [75] https://docs.python.org/2/library/re.html#regular-expression-syntax
  2929. [76] http://ctags.sourceforge.net/FORMAT
  2930. [77] https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
  2931. [78] https://groups.google.com/forum/?hl=en#!forum/ycm-users
  2932. [79] https://github.com/ycm-core/YouCompleteMe/issues?state=open
  2933. [80] https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md
  2934. [81] https://www.gnu.org/copyleft/gpl.html
  2935. vim: ft=help