youcompleteme.txt 166 KB

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