1
0

youcompleteme.txt 183 KB

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