youcompleteme.txt 144 KB

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