From 833d30eda88b46877cae7432ee832e4f8502d84c Mon Sep 17 00:00:00 2001 From: Chiel ten Brinke Date: Fri, 29 Jan 2016 10:40:34 +0100 Subject: [PATCH] Update vim docs. --- doc/youcompleteme.txt | 216 ++++++++++++++++++++++++++---------------- 1 file changed, 136 insertions(+), 80 deletions(-) diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index 94463865..b0b07ed2 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -142,12 +142,18 @@ Contents ~ 25. I get weird errors when I press 'Ctrl-C' in Vim |Ctrl-sub-C| 26. Why did YCM stop using Syntastic for diagnostics display? |youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display| 27. Completion doesn't work with the C++ standard library headers |youcompleteme-completion-doesnt-work-with-c-standard-library-headers| - 28. Install YCM with NeoBundle [51] |youcompleteme-install-ycm-with-neobundle-51| + 28. Install YCM with NeoBundle [52] |youcompleteme-install-ycm-with-neobundle-52| 29. When I open a JavaScript file, I get an annoying warning about '.tern-project' file |.tern-sub-project| - 11. Contact |youcompleteme-contact| - 12. License |youcompleteme-license| - 13. References |youcompleteme-references| + 30. When I run install.py I get a LINK error saying "fatal error LNK1104: cannot +open file '\bundle\YouCompleteMe\third_party\ycmd\ycm_clien +t_support.pyd'" |fatal-error-LNK1104:-cannot-open-file-path_to_vim_folder-bundle-YouCompleteMe-third_party-ycmd-ycm_client_support.pyd| + 31. When I start vim I get a runtime error saying 'R6034 An application has made an +attempt to load the C runtime library incorrectly.' |R6034-An-application-has-made-an-attempt-to-load-the-C-runtime-library-incorrectly.| + 11. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct| + 12. Contact |youcompleteme-contact| + 13. License |youcompleteme-license| + 14. References |youcompleteme-references| =============================================================================== *youcompleteme-introduction* @@ -187,6 +193,7 @@ Image: Build Status [1] Image: Build status [3] - Options - FAQ +- Contributor Code of Conduct - Contact - License @@ -527,18 +534,19 @@ Compiling YCM **without** semantic support for C-family languages: < The following additional language support options are available: -- C# support: add '--omnisharp-completer' to 'install.py' +- C# support: add '--omnisharp-completer' to 'install.py'. Be sure that the + build utility 'msbuild' is in your PATH [27]. -- Go support: ensure go is installed and add '--gocode-completer' +- Go support: ensure go is installed and add '--gocode-completer'. - TypeScript support: install nodejs and npm [20] then install the TypeScript SDK with 'npm install -g typescript'. - JavaScript support: install nodejs and npm [20] and add '--tern-completer' - to 'install.py' + to 'install.py'. - Rust support: install rustc and cargo [21] and add '--racer-completer' to - 'install.py' + 'install.py'. For example, to install with all language features, ensure npm, go, mono, rust, and typescript API are installed and in your '%PATH%', then: @@ -668,9 +676,9 @@ process. critical because it must match the python2 and the YCM libraries architectures. We recommend using a 64-bit Vim. -2. **Install YCM** with Vundle [17] (or Pathogen [27], but Vundle is a +2. **Install YCM** with Vundle [17] (or Pathogen [28], but Vundle is a better idea). With Vundle, this would mean adding a "Plugin - 'Valloric/YouCompleteMe'" line to your vimrc [28]. + 'Valloric/YouCompleteMe'" line to your vimrc [29]. If you don't install YCM with Vundle, make sure you have run 'git submodule update --init --recursive' after checking out the YCM @@ -687,7 +695,7 @@ process. You can use the system libclang _only if you are sure it is version 3.3 or higher_, otherwise don't. Even if it is, we recommend using the - official binaries from llvm.org [29] if at all possible. Make sure you + official binaries from llvm.org [30] if at all possible. Make sure you download the correct archive file for your OS. We **STRONGLY recommend AGAINST use** of the system libclang instead of @@ -797,7 +805,8 @@ process. 6. C# support: Navigate to 'YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer' and run 'msbuild' (Windows) or 'xbuild' (other platforms, using mono) depending - on your platform. If mono is not installed, install it. + on your platform. If mono is not installed, install it. When on Windows, + be sure that the build utility 'msbuild' is in your PATH [27]. 7. Go support: If go is not installed on your system, install it and add it to your path. Navigate to @@ -925,7 +934,7 @@ General Usage ~ through the completions. Use Shift-TAB to cycle backwards. Note that if you're using console Vim (that is, not Gvim or MacVim) then it's likely that the Shift-TAB binding will not work because the console will not pass - it to Vim. You can remap the keys; see the _Options [30]_ section below. + it to Vim. You can remap the keys; see the _Options [31]_ section below. Knowing a little bit about how YCM works internally will prevent confusion. YCM has several completion engines: an identifier-based completer that collects all @@ -996,20 +1005,20 @@ This system was designed this way so that the user can perform any arbitrary sequence of operations to produce a list of compilation flags YCM should hand to Clang. -See YCM's own '.ycm_extra_conf.py' [31] for details on how this works. You +See YCM's own '.ycm_extra_conf.py' [32] for details on how this works. You should be able to use it _as a starting point_. **Don't** just copy/paste that file somewhere and expect things to magically work; **your project needs different flags**. Hint: just replace the strings in the 'flags' variable with compilation flags necessary for your project. That should be enough for 99% of projects. -Yes, Clang's 'CompilationDatabase' system [32] is also supported. Again, see +Yes, Clang's 'CompilationDatabase' system [33] is also supported. Again, see the above linked example file. You can get CMake to generate this file for you by adding 'set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )' to your project's 'CMakeLists.txt' file (if using CMake). If you're not using CMake, you could -use something like Bear [33] to generate the 'compile_commands.json' file. +use something like Bear [34] to generate the 'compile_commands.json' file. -Consider using YCM-Generator [34] to generate the 'ycm_extra_conf.py' file. +Consider using YCM-Generator [35] to generate the 'ycm_extra_conf.py' file. If Clang encounters errors when compiling the header files that your file includes, then it's probably going to take a long time to get completions. When @@ -1034,7 +1043,7 @@ Quick start ~ guide for details. 2. Create a '.tern-project' file in the root directory of your JavaScript - project, by following the instructions [35] in the Tern [10] + project, by following the instructions [36] in the Tern [10] documentation. 3. Make sure that Vim's working directory is a descendent of that directory @@ -1045,13 +1054,13 @@ Quick start ~ Explanation ~ JavaScript completion is based on Tern [10]. This completion engine requires a -file named '.tern-project' [35] to exist in the current working directory or a +file named '.tern-project' [36] to exist in the current working directory or a directory which is an ancestor of the current working directory when the tern server is started. YCM starts the Tern server the first time a JavaScript file is edited, so Vim's working directory at that time needs to be a descendent of the directory containing the '.tern-project' file (or that directory itself). -Alternatively, as described in the Tern documentation [36], a global '.tern- +Alternatively, as described in the Tern documentation [37], a global '.tern- config' file may be used. Multiple Tern servers, are not supported. To switch to a different JavaScript @@ -1073,9 +1082,9 @@ Tips and tricks ~ This section contains some advice for configuring '.tern-project' and working with JavaScript files. The canonical reference for correctly configuring Tern -is the Tern documentation [36]. Any issues, improvements, advice, etc. should +is the Tern documentation [37]. Any issues, improvements, advice, etc. should be sought from the Tern [10] project. For example, see the list of tern plugins -[37] for the list of plugins which can be enabled in the 'plugins' section of +[38] for the list of plugins which can be enabled in the 'plugins' section of the '.tern-project' file. ------------------------------------------------------------------------------- @@ -1123,11 +1132,12 @@ Can be used as follows: *youcompleteme-rust-semantic-completion* Rust semantic completion ~ -Completions and GoTo* within the current crate and its dependencies should work -out of the box with no additional configuration. For semantic analysis -inclusive of the standard library, you must have a local copy of the rust -source code [38]. You also need to set the following option so YouCompleteMe -can locate it. +Completions and GoTo commands within the current crate and its dependencies +should work out of the box with no additional configuration (provided that you +built YCM with the '--racer-completer' flag; see the _Installation_ section for +details). For semantic analysis inclusive of the standard library, you must +have a local copy of the rust source code [39]. You also need to set the +following option so YouCompleteMe can locate it. > " In this example, the rust source code zip has been extracted to " /usr/local/rust/rustc-1.5.0 @@ -1147,7 +1157,7 @@ semantic completions if it does not have a native semantic completion engine for your file's filetype. Vim comes with okayish omnifuncs for various languages like Ruby, PHP etc. It depends on the language. -You can get stellar omnifuncs for Java and Ruby with Eclim [39]. Just make sure +You can get stellar omnifuncs for Java and Ruby with Eclim [40]. Just make sure you have the _latest_ Eclim installed and configured (this means Eclim '>= 2.2.*' and Eclipse '>= 4.2.*'). @@ -1165,7 +1175,7 @@ Writing New Semantic Completers ~ You have two options here: writing an 'omnifunc' for Vim's omnicomplete system that YCM will then use through its omni-completer, or a custom completer for -YCM using the Completer API [40]. +YCM using the Completer API [41]. Here are the differences between the two approaches: @@ -1184,7 +1194,7 @@ Here are the differences between the two approaches: than VimScript. If you want to use the 'omnifunc' system, see the relevant Vim docs with ':h -complete-functions'. For the Completer API, see the API docs [40]. +complete-functions'. For the Completer API, see the API docs [41]. If you want to upstream your completer into YCM's source, you should use the Completer API. @@ -1235,7 +1245,7 @@ current file in Vim's 'locationlist', which can be opened with the ':lopen' and ':lclose' commands (make sure you have set 'let g:ycm_always_populate_location_list = 1' in your vimrc). A good way to toggle the display of the 'locationlist' with a single key mapping is provided by -another (very small) Vim plugin called ListToggle [41] (which also makes it +another (very small) Vim plugin called ListToggle [42] (which also makes it possible to change the height of the 'locationlist' window), also written by yours truly. @@ -1623,7 +1633,7 @@ For example: call youcompleteme#GetErrorCount() < Both this function and |youcompleteme#GetWarningCount| can be useful when -integrating YCM with other Vim plugins. For example, a lightline [42] user +integrating YCM with other Vim plugins. For example, a lightline [43] user could add a diagnostics section to their statusline which would display the number of errors and warnings. @@ -1643,11 +1653,11 @@ Options ~ All options have reasonable defaults so if the plug-in works after installation you don't need to change any options. These options can be configured in your -vimrc script [28] by including a line like this: +vimrc script [29] by including a line like this: > let g:ycm_min_num_of_chars_for_completion = 1 < -Note that after changing an option in your vimrc script [28] you have to +Note that after changing an option in your vimrc script [29] you have to restart Vim for the changes to take effect. ------------------------------------------------------------------------------- @@ -1968,7 +1978,7 @@ from the 'tagfiles()' Vim function which examines the 'tags' Vim option. See YCM will re-index your tags files if it detects that they have been modified. -The only supported tag format is the Exuberant Ctags format [43]. The format +The only supported tag format is the Exuberant Ctags format [44]. The format from "plain" ctags is NOT supported. Ctags needs to be called with the '-- fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the 'language:' field in the tags output. @@ -2335,7 +2345,7 @@ It's also possible to use a regular expression as a trigger. You have to prefix your trigger with 're!' to signify it's a regex trigger. For instance, 're!\w+\.' would only trigger after the '\w+\.' regex matches. -NOTE: The regex syntax is **NOT** Vim's, it's Python's [44]. +NOTE: The regex syntax is **NOT** Vim's, it's Python's [45]. Default: '[see next line]' > @@ -2530,7 +2540,7 @@ I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting ~ You should probably run 'brew rm python; brew install python' to get the latest fixes that should make YCM work with such a configuration. Also rebuild Macvim -then. If you still get problems with this, see issue #18 [45] for suggestions. +then. If you still get problems with this, see issue #18 [46] for suggestions. ------------------------------------------------------------------------------- *youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files* @@ -2615,15 +2625,15 @@ YCM does not read identifiers from my tags files ~ First, put 'let g:ycm_collect_identifiers_from_tags_files = 1' in your vimrc. -Make sure you are using Exuberant Ctags [46] to produce your tags files since -the only supported tag format is the Exuberant Ctags format [43]. The format +Make sure you are using Exuberant Ctags [47] to produce your tags files since +the only supported tag format is the Exuberant Ctags format [44]. The format from "plain" ctags is NOT supported. The output of 'ctags --version' should list "Exuberant Ctags". Ctags needs to be called with the '--fields=+l' (that's a lowercase 'L', not a one) option because YCM needs the 'language:' field in the tags output. -NOTE: Exuberant Ctags [46] by default sets language tag for '*.h' files as +NOTE: Exuberant Ctags [47] by default sets language tag for '*.h' files as 'C++'. If you have C (not C++) project, consider giving parameter '-- langmap=c:.c.h' to ctags to see tags from '*.h' files. @@ -2694,7 +2704,7 @@ and similar, then just update to Vim 7.4.314 (or later) and they'll go away. *vim-sub-autoclose* Nasty bugs happen if I have the 'vim-autoclose' plugin installed ~ -Use the delimitMate [47] plugin instead. It does the same thing without +Use the delimitMate [48] plugin instead. It does the same thing without conflicting with YCM. ------------------------------------------------------------------------------- @@ -2702,7 +2712,7 @@ conflicting with YCM. Is there some sort of YCM mailing list? I have questions ~ If you have questions about the plugin or need help, please use the ycm-users -[48] mailing list, _don't_ create issues on the tracker. The tracker is for bug +[49] mailing list, _don't_ create issues on the tracker. The tracker is for bug reports and feature requests. ------------------------------------------------------------------------------- @@ -2756,7 +2766,7 @@ mismatch in assumptions causes performance problems since Syntastic code isn't optimized for this use case of constant diagnostic refreshing. Poor support for this use case also led to crash bugs in Vim caused by -Syntastic-Vim interactions (issue #593 [49]) and other problems, like random +Syntastic-Vim interactions (issue #593 [50]) and other problems, like random Vim flickering. Attempts were made to resolve these issues in Syntastic, but ultimately some of them failed (for various reasons). @@ -2792,13 +2802,13 @@ paths, prepend '-isystem' to each individual path and append them all to the list of flags you return from your 'FlagsForFile' function in your '.ycm_extra_conf.py' file. -See issue #303 [50] for details. +See issue #303 [51] for details. ------------------------------------------------------------------------------- - *youcompleteme-install-ycm-with-neobundle-51* -Install YCM with NeoBundle [51] ~ + *youcompleteme-install-ycm-with-neobundle-52* +Install YCM with NeoBundle [52] ~ -NeoBundle [51] can do the compilation for you; just add the following to your +NeoBundle [52] can do the compilation for you; just add the following to your vimrc: > NeoBundle 'Valloric/YouCompleteMe', { @@ -2827,15 +2837,58 @@ If this is still really annoying, and you have a good reason not to have a '.tern-project' file, create an empty '.tern-config' file in your home directory and YCM will stop complaining. +------------------------------------------------------------------------------- +*fatal-error-LNK1104:-cannot-open-file-path_to_vim_folder-bundle-YouCompleteMe-third_party-ycmd-ycm_client_support.pyd* +When I run install.py I get a LINK error saying "fatal error LNK1104: cannot ~ +open file ~ +'\bundle\YouCompleteMe\third_party\ycmd\ycm_clien ~ +t_support.pyd'" ~ + +Be sure to have closed all vim instances before you build YouCompleteMe. + +------------------------------------------------------------------------------- +*R6034-An-application-has-made-an-attempt-to-load-the-C-runtime-library-incorrectly.* +When I start vim I get a runtime error saying 'R6034 An application has made ~ +an attempt to load the C runtime library incorrectly.' ~ + +CMake and other things seem to screw up the PATH with their own msvcrXX.dll +versions. [53] Add the following to the very top of your vimrc to remove these +entries from the path. +> + python << EOF + import os + import re + path = os.environ['PATH'].split(';') + + def contains_msvcr_lib(folder): + try: + for item in os.listdir(folder): + if re.match(r'msvcr\d+\.dll', item): + return True + except: + pass + return False + + path = [folder for folder in path if not contains_msvcr_lib(folder)] + os.environ['PATH'] = ';'.join(path) + EOF +< +=============================================================================== + *youcompleteme-contributor-code-of-conduct* +Contributor Code of Conduct ~ + +Please note that this project is released with a Contributor Code of Conduct +[54]. By participating in this project you agree to abide by its terms. + =============================================================================== *youcompleteme-contact* Contact ~ If you have questions about the plugin or need help, please use the ycm-users -[48] mailing list. +[49] mailing list. If you have bug reports or feature suggestions, please use the issue tracker -[52]. +[55]. The latest version of the plugin is available at http://valloric.github.io/YouCompleteMe/. @@ -2846,10 +2899,10 @@ The author's homepage is http://val.markovic.io. *youcompleteme-license* License ~ -This software is licensed under the GPL v3 license [53]. © 2015 YouCompleteMe +This software is licensed under the GPL v3 license [56]. © 2015 YouCompleteMe contributors - Image: Bitdeli Badge [54] + Image: Bitdeli Badge [57] =============================================================================== *youcompleteme-references* @@ -2881,34 +2934,37 @@ References ~ [24] https://www.python.org/downloads/windows/ [25] https://www.visualstudio.com/products/free-developer-offers-vs.aspx [26] http://www.7-zip.org/download.html -[27] https://github.com/tpope/vim-pathogen#pathogenvim -[28] http://vimhelp.appspot.com/starting.txt.html#vimrc -[29] http://llvm.org/releases/download.html -[30] https://github.com/Valloric/YouCompleteMe#options -[31] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py -[32] http://clang.llvm.org/docs/JSONCompilationDatabase.html -[33] https://github.com/rizsotto/Bear -[34] https://github.com/rdnetto/YCM-Generator -[35] http://ternjs.net/doc/manual.html#configuration -[36] http://ternjs.net/doc/manual.html#server -[37] http://ternjs.net/doc/manual.html#plugins -[38] https://www.rust-lang.org/downloads.html -[39] http://eclim.org/ -[40] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py -[41] https://github.com/Valloric/ListToggle -[42] https://github.com/itchyny/lightline.vim -[43] http://ctags.sourceforge.net/FORMAT -[44] https://docs.python.org/2/library/re.html#regular-expression-syntax -[45] https://github.com/Valloric/YouCompleteMe/issues/18 -[46] http://ctags.sourceforge.net/ -[47] https://github.com/Raimondi/delimitMate -[48] https://groups.google.com/forum/?hl=en#!forum/ycm-users -[49] https://github.com/Valloric/YouCompleteMe/issues/593 -[50] https://github.com/Valloric/YouCompleteMe/issues/303 -[51] https://github.com/Shougo/neobundle.vim -[52] https://github.com/Valloric/YouCompleteMe/issues?state=open -[53] http://www.gnu.org/copyleft/gpl.html -[54] https://bitdeli.com/free -[55] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png +[27] http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1 +[28] https://github.com/tpope/vim-pathogen#pathogenvim +[29] http://vimhelp.appspot.com/starting.txt.html#vimrc +[30] http://llvm.org/releases/download.html +[31] https://github.com/Valloric/YouCompleteMe#options +[32] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py +[33] http://clang.llvm.org/docs/JSONCompilationDatabase.html +[34] https://github.com/rizsotto/Bear +[35] https://github.com/rdnetto/YCM-Generator +[36] http://ternjs.net/doc/manual.html#configuration +[37] http://ternjs.net/doc/manual.html#server +[38] http://ternjs.net/doc/manual.html#plugins +[39] https://www.rust-lang.org/downloads.html +[40] http://eclim.org/ +[41] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py +[42] https://github.com/Valloric/ListToggle +[43] https://github.com/itchyny/lightline.vim +[44] http://ctags.sourceforge.net/FORMAT +[45] https://docs.python.org/2/library/re.html#regular-expression-syntax +[46] https://github.com/Valloric/YouCompleteMe/issues/18 +[47] http://ctags.sourceforge.net/ +[48] https://github.com/Raimondi/delimitMate +[49] https://groups.google.com/forum/?hl=en#!forum/ycm-users +[50] https://github.com/Valloric/YouCompleteMe/issues/593 +[51] https://github.com/Valloric/YouCompleteMe/issues/303 +[52] https://github.com/Shougo/neobundle.vim +[53] http://stackoverflow.com/questions/14552348/runtime-error-r6034-in-embedded-python-application/34696022 +[54] https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md +[55] https://github.com/Valloric/YouCompleteMe/issues?state=open +[56] http://www.gnu.org/copyleft/gpl.html +[57] https://bitdeli.com/free +[58] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png vim: ft=help