youcompleteme.txt 150 KB

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