Updating docs from README
This commit is contained in:
parent
a70bf21d29
commit
6ba88ccce5
@ -17,11 +17,9 @@ Contents ~
|
|||||||
3. Completion string ranking |youcompleteme-completion-string-ranking|
|
3. Completion string ranking |youcompleteme-completion-string-ranking|
|
||||||
4. General Semantic Completion Engine Usage |youcompleteme-general-semantic-completion-engine-usage|
|
4. General Semantic Completion Engine Usage |youcompleteme-general-semantic-completion-engine-usage|
|
||||||
5. C-family Semantic Completion Engine Usage |youcompleteme-c-family-semantic-completion-engine-usage|
|
5. C-family Semantic Completion Engine Usage |youcompleteme-c-family-semantic-completion-engine-usage|
|
||||||
6. Python semantic completion |youcompleteme-python-semantic-completion|
|
6. Semantic completion for other languages |youcompleteme-semantic-completion-for-other-languages|
|
||||||
7. C# semantic completion |youcompleteme-c-semantic-completion|
|
7. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|
|
||||||
8. Semantic completion for other languages |youcompleteme-semantic-completion-for-other-languages|
|
8. Diagnostic display |youcompleteme-diagnostic-display|
|
||||||
9. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|
|
|
||||||
10. Diagnostic display |youcompleteme-diagnostic-display|
|
|
||||||
1. C# Diagnostic Support |youcompleteme-c-diagnostic-support|
|
1. C# Diagnostic Support |youcompleteme-c-diagnostic-support|
|
||||||
2. Diagnostic highlighting groups |youcompleteme-diagnostic-highlighting-groups|
|
2. Diagnostic highlighting groups |youcompleteme-diagnostic-highlighting-groups|
|
||||||
5. Commands |youcompleteme-commands|
|
5. Commands |youcompleteme-commands|
|
||||||
@ -119,6 +117,7 @@ Contents ~
|
|||||||
25. I get weird errors when I press 'Ctrl-C' in Vim |Ctrl-sub-C|
|
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|
|
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|
|
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 [36] |youcompleteme-install-ycm-with-neobundle-36|
|
||||||
9. Contact |youcompleteme-contact|
|
9. Contact |youcompleteme-contact|
|
||||||
10. Project Management |youcompleteme-project-management|
|
10. Project Management |youcompleteme-project-management|
|
||||||
11. License |youcompleteme-license|
|
11. License |youcompleteme-license|
|
||||||
@ -146,8 +145,6 @@ Introduction ~
|
|||||||
- Completion string ranking
|
- Completion string ranking
|
||||||
- General semantic completion
|
- General semantic completion
|
||||||
- C-family semantic completion
|
- C-family semantic completion
|
||||||
- Python semantic completion
|
|
||||||
- C# semantic completion
|
|
||||||
- Semantic completion for other languages
|
- Semantic completion for other languages
|
||||||
- Writing new semantic completers
|
- Writing new semantic completers
|
||||||
- Diagnostic display
|
- Diagnostic display
|
||||||
@ -173,11 +170,12 @@ Vim. It has several completion engines: an identifier-based engine that works
|
|||||||
with every programming language, a semantic, Clang [3]-based engine that
|
with every programming language, a semantic, Clang [3]-based engine that
|
||||||
provides native semantic code completion for C/C++/Objective-C/Objective-C++
|
provides native semantic code completion for C/C++/Objective-C/Objective-C++
|
||||||
(from now on referred to as "the C-family languages"), a Jedi [4]-based
|
(from now on referred to as "the C-family languages"), a Jedi [4]-based
|
||||||
completion engine for Python, an OmniSharp [5]-based completion engine for C#
|
completion engine for Python, an OmniSharp [5]-based completion engine for C#,
|
||||||
and an omnifunc-based completer that uses data from Vim's omnicomplete system
|
a Gocode [6]-based completion engine for Go, and an omnifunc-based completer
|
||||||
to provide semantic completions for many other languages (Ruby, PHP etc.).
|
that uses data from Vim's omnicomplete system to provide semantic completions
|
||||||
|
for many other languages (Ruby, PHP etc.).
|
||||||
|
|
||||||
Image: YouCompleteMe GIF demo (see reference [6])
|
Image: YouCompleteMe GIF demo (see reference [7])
|
||||||
|
|
||||||
Here's an explanation of what happens in the short GIF demo above.
|
Here's an explanation of what happens in the short GIF demo above.
|
||||||
|
|
||||||
@ -196,7 +194,7 @@ typing to further filter out unwanted completions.
|
|||||||
|
|
||||||
A critical thing to notice is that the completion **filtering is NOT based on
|
A critical thing to notice is that the completion **filtering is NOT based on
|
||||||
the input being a string prefix of the completion** (but that works too). The
|
the input being a string prefix of the completion** (but that works too). The
|
||||||
input needs to be a _subsequence [7] match_ of a completion. This is a fancy
|
input needs to be a _subsequence [8] match_ of a completion. This is a fancy
|
||||||
way of saying that any input characters need to be present in a completion
|
way of saying that any input characters need to be present in a completion
|
||||||
string in the order in which they appear in the input. So 'abc' is a
|
string in the order in which they appear in the input. So 'abc' is a
|
||||||
subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated
|
subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated
|
||||||
@ -215,7 +213,7 @@ with a keyboard shortcut; see the rest of the docs).
|
|||||||
|
|
||||||
The last thing that you can see in the demo is YCM's diagnostic display
|
The last thing that you can see in the demo is YCM's diagnostic display
|
||||||
features (the little red X that shows up in the left gutter; inspired by
|
features (the little red X that shows up in the left gutter; inspired by
|
||||||
Syntastic [8]) if you are editing a C-family file. As Clang compiles your file
|
Syntastic [9]) if you are editing a C-family file. As Clang compiles your file
|
||||||
and detects warnings or errors, they will be presented in various ways. You
|
and detects warnings or errors, they will be presented in various ways. You
|
||||||
don't need to save your file or press any keyboard shortcut to trigger this, it
|
don't need to save your file or press any keyboard shortcut to trigger this, it
|
||||||
"just happens" in the background.
|
"just happens" in the background.
|
||||||
@ -233,7 +231,7 @@ languages & Python. Expect more IDE features powered by the various YCM
|
|||||||
semantic engines in the future.
|
semantic engines in the future.
|
||||||
|
|
||||||
You'll also find that YCM has filepath completers (try typing './' in a file)
|
You'll also find that YCM has filepath completers (try typing './' in a file)
|
||||||
and a completer that integrates with UltiSnips [9].
|
and a completer that integrates with UltiSnips [10].
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-installation*
|
*youcompleteme-installation*
|
||||||
@ -246,27 +244,28 @@ Mac OS X super-quick installation ~
|
|||||||
Please refer to the full Installation Guide below; the following commands are
|
Please refer to the full Installation Guide below; the following commands are
|
||||||
provided on a best-effort basis and may not work for you.
|
provided on a best-effort basis and may not work for you.
|
||||||
|
|
||||||
Install the latest version of MacVim [10]. Yes, MacVim. And yes, the _latest_.
|
Install the latest version of MacVim [11]. Yes, MacVim. And yes, the _latest_.
|
||||||
|
|
||||||
If you don't use the MacVim GUI, it is recommended to use the Vim binary that
|
If you don't use the MacVim GUI, it is recommended to use the Vim binary that
|
||||||
is inside the MacVim.app package ('MacVim.app/Contents/MacOS/Vim'). To ensure
|
is inside the MacVim.app package ('MacVim.app/Contents/MacOS/Vim'). To ensure
|
||||||
it works correctly copy the 'mvim' script from the MacVim [10] download to your
|
it works correctly copy the 'mvim' script from the MacVim [11] download to your
|
||||||
local binary folder (for example '/usr/local/bin/mvim') and then symlink it:
|
local binary folder (for example '/usr/local/bin/mvim') and then symlink it:
|
||||||
>
|
>
|
||||||
ln -s /usr/local/bin/mvim vim
|
ln -s /usr/local/bin/mvim vim
|
||||||
<
|
<
|
||||||
Install YouCompleteMe with Vundle [11].
|
Install YouCompleteMe with Vundle [12].
|
||||||
|
|
||||||
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
||||||
using Vundle and the ycm_support_libs library APIs have changed (happens
|
using Vundle and the ycm_support_libs library APIs have changed (happens
|
||||||
rarely), YCM will notify you to recompile it. You should then rerun the install
|
rarely), YCM will notify you to recompile it. You should then rerun the install
|
||||||
process.
|
process.
|
||||||
|
|
||||||
It's recommended that you have the latest Xcode installed along with the latest
|
**NOTE:** If you want C-family completion, you MUST have the latest Xcode
|
||||||
Command Line Tools (that you install from within Xcode).
|
installed along with the latest Command Line Tools (they are installed when you
|
||||||
|
start Xcode for the first time).
|
||||||
|
|
||||||
Install CMake. Preferably with Homebrew [12], but here's the stand-alone CMake
|
Install CMake. Preferably with Homebrew [13], but here's the stand-alone CMake
|
||||||
installer [13].
|
installer [14].
|
||||||
|
|
||||||
_If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_
|
_If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_
|
||||||
for details.
|
for details.
|
||||||
@ -282,7 +281,8 @@ Compiling YCM **without** semantic support for C-family languages:
|
|||||||
./install.sh
|
./install.sh
|
||||||
<
|
<
|
||||||
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
||||||
install script as well.
|
install script as well. If you want Go support, you should add '--gocode-
|
||||||
|
completer'.
|
||||||
|
|
||||||
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
||||||
Don't forget that if you want the C-family semantic completion engine to work,
|
Don't forget that if you want the C-family semantic completion engine to work,
|
||||||
@ -303,9 +303,9 @@ provided on a best-effort basis and may not work for you.
|
|||||||
Make sure you have Vim 7.3.584 with python2 support. Ubuntu 14.04 and later
|
Make sure you have Vim 7.3.584 with python2 support. Ubuntu 14.04 and later
|
||||||
have a Vim that's recent enough. You can see the version of Vim installed by
|
have a Vim that's recent enough. You can see the version of Vim installed by
|
||||||
running 'vim --version'. If the version is too old, you may need to compile Vim
|
running 'vim --version'. If the version is too old, you may need to compile Vim
|
||||||
from source [14] (don't worry, it's easy).
|
from source [15] (don't worry, it's easy).
|
||||||
|
|
||||||
Install YouCompleteMe with Vundle [11].
|
Install YouCompleteMe with Vundle [12].
|
||||||
|
|
||||||
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
||||||
using Vundle and the ycm_support_libs library APIs have changed (happens
|
using Vundle and the ycm_support_libs library APIs have changed (happens
|
||||||
@ -328,7 +328,8 @@ Compiling YCM **without** semantic support for C-family languages:
|
|||||||
./install.sh
|
./install.sh
|
||||||
<
|
<
|
||||||
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
||||||
install script as well.
|
install script as well. If you want Go support, you should add '--gocode-
|
||||||
|
completer'.
|
||||||
|
|
||||||
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
||||||
Don't forget that if you want the C-family semantic completion engine to work,
|
Don't forget that if you want the C-family semantic completion engine to work,
|
||||||
@ -344,7 +345,7 @@ that are conservatively turned off by default that you may want to turn on.
|
|||||||
Windows Installation ~
|
Windows Installation ~
|
||||||
|
|
||||||
YCM has **no official support for Windows**, but that doesn't mean you can't
|
YCM has **no official support for Windows**, but that doesn't mean you can't
|
||||||
get it to work there. See the Windows Installation Guide [15] wiki page. Feel
|
get it to work there. See the Windows Installation Guide [16] wiki page. Feel
|
||||||
free to add to it.
|
free to add to it.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -365,7 +366,7 @@ FreeBSD 10.x comes with clang compiler but not the libraries needed to install.
|
|||||||
pkg install llvm35 boost-all boost-python-libs clang35
|
pkg install llvm35 boost-all boost-python-libs clang35
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/llvm35/lib/
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/llvm35/lib/
|
||||||
<
|
<
|
||||||
Install YouCompleteMe with Vundle [11].
|
Install YouCompleteMe with Vundle [12].
|
||||||
|
|
||||||
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
|
||||||
using Vundle and the ycm_support_libs library APIs have changed (happens
|
using Vundle and the ycm_support_libs library APIs have changed (happens
|
||||||
@ -385,7 +386,8 @@ Compiling YCM **without** semantic support for C-family languages:
|
|||||||
./install.sh --system-boost
|
./install.sh --system-boost
|
||||||
<
|
<
|
||||||
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
If you want semantic C# support, you should add '--omnisharp-completer' to the
|
||||||
install script as well.
|
install script as well. If you want Go support, you should add '--gocode-
|
||||||
|
completer'.
|
||||||
|
|
||||||
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
|
||||||
Don't forget that if you want the C-family semantic completion engine to work,
|
Don't forget that if you want the C-family semantic completion engine to work,
|
||||||
@ -425,15 +427,15 @@ process.
|
|||||||
1-Z', where Z will be some number. That number needs to be 584 or higher.
|
1-Z', where Z will be some number. That number needs to be 584 or higher.
|
||||||
|
|
||||||
If your version of Vim is not recent enough, you may need to compile Vim
|
If your version of Vim is not recent enough, you may need to compile Vim
|
||||||
from source [14] (don't worry, it's easy).
|
from source [15] (don't worry, it's easy).
|
||||||
|
|
||||||
After you have made sure that you have Vim 7.3.584+, type the following
|
After you have made sure that you have Vim 7.3.584+, type the following
|
||||||
in Vim: ":echo has('python')". The output should be 1. If it's 0, then
|
in Vim: ":echo has('python')". The output should be 1. If it's 0, then
|
||||||
get a version of Vim with Python support.
|
get a version of Vim with Python support.
|
||||||
|
|
||||||
2. **Install YCM** with Vundle [11] (or Pathogen [16], but Vundle is a
|
2. **Install YCM** with Vundle [12] (or Pathogen [17], but Vundle is a
|
||||||
better idea). With Vundle, this would mean adding a "Plugin
|
better idea). With Vundle, this would mean adding a "Plugin
|
||||||
'Valloric/YouCompleteMe'" line to your vimrc [17].
|
'Valloric/YouCompleteMe'" line to your vimrc [18].
|
||||||
|
|
||||||
If you don't install YCM with Vundle, make sure you have run 'git
|
If you don't install YCM with Vundle, make sure you have run 'git
|
||||||
submodule update --init --recursive' after checking out the YCM
|
submodule update --init --recursive' after checking out the YCM
|
||||||
@ -450,7 +452,7 @@ process.
|
|||||||
|
|
||||||
You can use the system libclang _only if you are sure it is version 3.3
|
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
|
or higher_, otherwise don't. Even if it is, we recommend using the
|
||||||
official binaries from llvm.org [18] if at all possible. Make sure you
|
official binaries from llvm.org [19] if at all possible. Make sure you
|
||||||
download the correct archive file for your OS.
|
download the correct archive file for your OS.
|
||||||
|
|
||||||
We **STRONGLY recommend AGAINST use** of the system libclang instead of
|
We **STRONGLY recommend AGAINST use** of the system libclang instead of
|
||||||
@ -463,8 +465,8 @@ process.
|
|||||||
You will need to have 'cmake' installed in order to generate the required
|
You will need to have 'cmake' installed in order to generate the required
|
||||||
makefiles. Linux users can install cmake with their package manager
|
makefiles. Linux users can install cmake with their package manager
|
||||||
('sudo apt-get install cmake' for Ubuntu) whereas other users can
|
('sudo apt-get install cmake' for Ubuntu) whereas other users can
|
||||||
download and install [13] cmake from its project site. Mac users can also
|
download and install [14] cmake from its project site. Mac users can also
|
||||||
get it through Homebrew [12] with 'brew install cmake'.
|
get it through Homebrew [13] with 'brew install cmake'.
|
||||||
|
|
||||||
You also need to make sure you have Python headers installed. On a
|
You also need to make sure you have Python headers installed. On a
|
||||||
Debian-like Linux distro, this would be 'sudo apt-get install python-
|
Debian-like Linux distro, this would be 'sudo apt-get install python-
|
||||||
@ -562,7 +564,7 @@ General Usage ~
|
|||||||
through the completions. Use Shift-TAB to cycle backwards. Note that if
|
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
|
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
|
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 [19]_ section below.
|
it to Vim. You can remap the keys; see the _Options [20]_ section below.
|
||||||
|
|
||||||
Knowing a little bit about how YCM works internally will prevent confusion. YCM
|
Knowing a little bit about how YCM works internally will prevent confusion. YCM
|
||||||
has several completion engines: an identifier-based completer that collects all
|
has several completion engines: an identifier-based completer that collects all
|
||||||
@ -633,20 +635,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
|
sequence of operations to produce a list of compilation flags YCM should hand
|
||||||
to Clang.
|
to Clang.
|
||||||
|
|
||||||
See YCM's own '.ycm_extra_conf.py' [20] for details on how this works. You
|
See YCM's own '.ycm_extra_conf.py' [21] for details on how this works. You
|
||||||
should be able to use it _as a starting point_. **Don't** just copy/paste that
|
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
|
file somewhere and expect things to magically work; **your project needs
|
||||||
different flags**. Hint: just replace the strings in the 'flags' variable with
|
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
|
compilation flags necessary for your project. That should be enough for 99% of
|
||||||
projects.
|
projects.
|
||||||
|
|
||||||
Yes, Clang's 'CompilationDatabase' system [21] is also supported. Again, see
|
Yes, Clang's 'CompilationDatabase' system [22] is also supported. Again, see
|
||||||
the above linked example file. You can get CMake to generate this file for you
|
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
|
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
|
'CMakeLists.txt' file (if using CMake). If you're not using CMake, you could
|
||||||
use something like Bear [22] to generate the 'compile_commands.json' file.
|
use something like Bear [23] to generate the 'compile_commands.json' file.
|
||||||
|
|
||||||
Consider using YCM-Generator [23] to generate the 'ycm_extra_conf.py' file.
|
Consider using YCM-Generator [24] to generate the 'ycm_extra_conf.py' file.
|
||||||
|
|
||||||
If Clang encounters errors when compiling the header files that your 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
|
includes, then it's probably going to take a long time to get completions. When
|
||||||
@ -659,44 +661,20 @@ to getting fast completions.
|
|||||||
Call the |:YcmDiags| command to see if any errors or warnings were detected in
|
Call the |:YcmDiags| command to see if any errors or warnings were detected in
|
||||||
your file.
|
your file.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*youcompleteme-python-semantic-completion*
|
|
||||||
Python semantic completion ~
|
|
||||||
|
|
||||||
YCM uses Jedi [4] to power its semantic completion for Python. This should
|
|
||||||
"just work" without any configuration from the user. You do NOT need to install
|
|
||||||
Jedi yourself; YCM uses it as a git subrepo. If you're installing YCM with
|
|
||||||
Vundle (which is the recommended way) then Vundle will make sure that the
|
|
||||||
subrepo is checked out when you do ':PluginInstall'. If you're installing YCM
|
|
||||||
by hand, then you need to run 'git submodule update --init --recursive' when
|
|
||||||
you're checking out the YCM repository. That's it.
|
|
||||||
|
|
||||||
But again, installing YCM with Vundle takes care of all of this for you.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
*youcompleteme-c-semantic-completion*
|
|
||||||
C# semantic completion ~
|
|
||||||
|
|
||||||
YCM uses OmniSharp [5] to provide semantic completion for C#. It's used as a
|
|
||||||
git subrepo. If you're installing YCM with Vundle (which is the recommended
|
|
||||||
way) then Vundle will make sure that the subrepo is checked out when you do
|
|
||||||
':PluginInstall'. If you're installing YCM by hand, then you need to run 'git
|
|
||||||
submodule update --init --recursive' when you're checking out the YCM
|
|
||||||
repository.
|
|
||||||
|
|
||||||
OmniSharp is written in C# and has to be compiled. The 'install.sh' script
|
|
||||||
takes care of this if you pass '--omnisharp-completer' as an argument.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
*youcompleteme-semantic-completion-for-other-languages*
|
*youcompleteme-semantic-completion-for-other-languages*
|
||||||
Semantic completion for other languages ~
|
Semantic completion for other languages ~
|
||||||
|
|
||||||
|
Python, C#, and Go are supported natively by YouCompleteMe using the Jedi [4],
|
||||||
|
Omnisharp [5], and Gocode [6] engines, respectively. Check the installation
|
||||||
|
section for instructions to enable these features if desired.
|
||||||
|
|
||||||
YCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for
|
YCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for
|
||||||
semantic completions if it does not have a native semantic completion engine
|
semantic completions if it does not have a native semantic completion engine
|
||||||
for your file's filetype. Vim comes with okayish omnifuncs for various
|
for your file's filetype. Vim comes with okayish omnifuncs for various
|
||||||
languages like Ruby, PHP etc. It depends on the language.
|
languages like Ruby, PHP etc. It depends on the language.
|
||||||
|
|
||||||
You can get stellar omnifuncs for Java and Ruby with Eclim [24]. Just make sure
|
You can get stellar omnifuncs for Java and Ruby with Eclim [25]. Just make sure
|
||||||
you have the _latest_ Eclim installed and configured (this means Eclim '>=
|
you have the _latest_ Eclim installed and configured (this means Eclim '>=
|
||||||
2.2.*' and Eclipse '>= 4.2.*').
|
2.2.*' and Eclipse '>= 4.2.*').
|
||||||
|
|
||||||
@ -714,7 +692,7 @@ Writing New Semantic Completers ~
|
|||||||
|
|
||||||
You have two options here: writing an 'omnifunc' for Vim's omnicomplete system
|
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
|
that YCM will then use through its omni-completer, or a custom completer for
|
||||||
YCM using the Completer API [25].
|
YCM using the Completer API [26].
|
||||||
|
|
||||||
Here are the differences between the two approaches:
|
Here are the differences between the two approaches:
|
||||||
|
|
||||||
@ -733,7 +711,7 @@ Here are the differences between the two approaches:
|
|||||||
than VimScript.
|
than VimScript.
|
||||||
|
|
||||||
If you want to use the 'omnifunc' system, see the relevant Vim docs with ':h
|
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 [25].
|
complete-functions'. For the Completer API, see the API docs [26].
|
||||||
|
|
||||||
If you want to upstream your completer into YCM's source, you should use the
|
If you want to upstream your completer into YCM's source, you should use the
|
||||||
Completer API.
|
Completer API.
|
||||||
@ -784,7 +762,7 @@ current file in Vim's 'locationlist', which can be opened with the ':lopen' and
|
|||||||
':lclose' commands (make sure you have set 'let
|
':lclose' commands (make sure you have set 'let
|
||||||
g:ycm_always_populate_location_list = 1' in your vimrc). A good way to toggle
|
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
|
the display of the 'locationlist' with a single key mapping is provided by
|
||||||
another (very small) Vim plugin called ListToggle [26] (which also makes it
|
another (very small) Vim plugin called ListToggle [27] (which also makes it
|
||||||
possible to change the height of the 'locationlist' window), also written by
|
possible to change the height of the 'locationlist' window), also written by
|
||||||
yours truly.
|
yours truly.
|
||||||
|
|
||||||
@ -1078,11 +1056,11 @@ Options ~
|
|||||||
|
|
||||||
All options have reasonable defaults so if the plug-in works after installation
|
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
|
you don't need to change any options. These options can be configured in your
|
||||||
vimrc script [17] by including a line like this:
|
vimrc script [18] by including a line like this:
|
||||||
>
|
>
|
||||||
let g:ycm_min_num_of_chars_for_completion = 1
|
let g:ycm_min_num_of_chars_for_completion = 1
|
||||||
<
|
<
|
||||||
Note that after changing an option in your vimrc script [17] you have to
|
Note that after changing an option in your vimrc script [18] you have to
|
||||||
restart Vim for the changes to take effect.
|
restart Vim for the changes to take effect.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -1402,7 +1380,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.
|
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 [27]. The format
|
The only supported tag format is the Exuberant Ctags format [28]. The format
|
||||||
from "plain" ctags is NOT supported. Ctags needs to be called with the '--
|
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
|
fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the
|
||||||
'language:<lang>' field in the tags output.
|
'language:<lang>' field in the tags output.
|
||||||
@ -1762,7 +1740,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,
|
your trigger with 're!' to signify it's a regex trigger. For instance,
|
||||||
're!\w+\.' would only trigger after the '\w+\.' regex matches.
|
're!\w+\.' would only trigger after the '\w+\.' regex matches.
|
||||||
|
|
||||||
NOTE: The regex syntax is **NOT** Vim's, it's Python's [28].
|
NOTE: The regex syntax is **NOT** Vim's, it's Python's [29].
|
||||||
|
|
||||||
Default: '[see next line]'
|
Default: '[see next line]'
|
||||||
>
|
>
|
||||||
@ -1785,9 +1763,9 @@ The *g:ycm_cache_omnifunc* option
|
|||||||
|
|
||||||
Some omnicompletion engines do not work well with the YCM cache—in particular,
|
Some omnicompletion engines do not work well with the YCM cache—in particular,
|
||||||
they might not produce all possible results for a given prefix. By unsetting
|
they might not produce all possible results for a given prefix. By unsetting
|
||||||
this option you can ensure that the omnicompletion engine is requeried on every
|
this option you can ensure that the omnicompletion engine is re-queried on
|
||||||
keypress. That will ensure all completions will be presented, but might cause
|
every keypress. That will ensure all completions will be presented, but might
|
||||||
stuttering and lagginess if the omnifunc is slow.
|
cause stuttering and lagginess if the omnifunc is slow.
|
||||||
|
|
||||||
Default: '1'
|
Default: '1'
|
||||||
>
|
>
|
||||||
@ -1808,9 +1786,9 @@ The *g:ycm_goto_buffer_command* option
|
|||||||
|
|
||||||
Defines where 'GoTo*' commands result should be opened. Can take one of the
|
Defines where 'GoTo*' commands result should be opened. Can take one of the
|
||||||
following values: "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-
|
following values: "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-
|
||||||
tab' ]" If this option is set to the "'same-buffer'" but current buffer can not
|
tab', 'new-or-existing-tab' ]" If this option is set to the "'same-buffer'" but
|
||||||
be switched (when buffer is modified and 'nohidden' option is set), then result
|
current buffer can not be switched (when buffer is modified and 'nohidden'
|
||||||
will be opened in horizontal split.
|
option is set), then result will be opened in horizontal split.
|
||||||
|
|
||||||
Default: "'same-buffer'"
|
Default: "'same-buffer'"
|
||||||
>
|
>
|
||||||
@ -1945,7 +1923,7 @@ produced. See the full installation guide for help.
|
|||||||
I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults ~
|
I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults ~
|
||||||
|
|
||||||
Something (I don't know what) is wrong with the way that Homebrew configures
|
Something (I don't know what) is wrong with the way that Homebrew configures
|
||||||
and builds Vim. I recommend using MacVim [10]. Even if you don't like the
|
and builds Vim. I recommend using MacVim [11]. Even if you don't like the
|
||||||
MacVim GUI, you can use the Vim binary that is inside the MacVim.app package
|
MacVim GUI, you can use the Vim binary that is inside the MacVim.app package
|
||||||
(it's 'MacVim.app/Contents/MacOS/Vim') and get the Vim console experience.
|
(it's 'MacVim.app/Contents/MacOS/Vim') and get the Vim console experience.
|
||||||
|
|
||||||
@ -1955,7 +1933,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
|
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
|
fixes that should make YCM work with such a configuration. Also rebuild Macvim
|
||||||
then. If you still get problems with this, see issue #18 [29] for suggestions.
|
then. If you still get problems with this, see issue #18 [30] for suggestions.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
*youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files*
|
*youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files*
|
||||||
@ -2040,8 +2018,8 @@ YCM does not read identifiers from my tags files ~
|
|||||||
|
|
||||||
First, put 'let g:ycm_collect_identifiers_from_tags_files = 1' in your vimrc.
|
First, put 'let g:ycm_collect_identifiers_from_tags_files = 1' in your vimrc.
|
||||||
|
|
||||||
Make sure you are using Exuberant Ctags [30] to produce your tags files since
|
Make sure you are using Exuberant Ctags [31] to produce your tags files since
|
||||||
the only supported tag format is the Exuberant Ctags format [27]. The format
|
the only supported tag format is the Exuberant Ctags format [28]. The format
|
||||||
from "plain" ctags is NOT supported. The output of 'ctags --version' should
|
from "plain" ctags is NOT supported. The output of 'ctags --version' should
|
||||||
list "Exuberant Ctags".
|
list "Exuberant Ctags".
|
||||||
|
|
||||||
@ -2115,7 +2093,7 @@ and similar, then just update to Vim 7.4.314 (or later) and they'll go away.
|
|||||||
*vim-sub-autoclose*
|
*vim-sub-autoclose*
|
||||||
Nasty bugs happen if I have the 'vim-autoclose' plugin installed ~
|
Nasty bugs happen if I have the 'vim-autoclose' plugin installed ~
|
||||||
|
|
||||||
Use the delimitMate [31] plugin instead. It does the same thing without
|
Use the delimitMate [32] plugin instead. It does the same thing without
|
||||||
conflicting with YCM.
|
conflicting with YCM.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -2123,7 +2101,7 @@ conflicting with YCM.
|
|||||||
Is there some sort of YCM mailing list? I have questions ~
|
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
|
If you have questions about the plugin or need help, please use the ycm-users
|
||||||
[32] mailing list, _don't_ create issues on the tracker. The tracker is for bug
|
[33] mailing list, _don't_ create issues on the tracker. The tracker is for bug
|
||||||
reports and feature requests.
|
reports and feature requests.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -2177,7 +2155,7 @@ mismatch in assumptions causes performance problems since Syntastic code isn't
|
|||||||
optimized for this use case of constant diagnostic refreshing.
|
optimized for this use case of constant diagnostic refreshing.
|
||||||
|
|
||||||
Poor support for this use case also led to crash bugs in Vim caused by
|
Poor support for this use case also led to crash bugs in Vim caused by
|
||||||
Syntastic-Vim interactions (issue #593 [33]) and other problems, like random
|
Syntastic-Vim interactions (issue #593 [34]) and other problems, like random
|
||||||
Vim flickering. Attempts were made to resolve these issues in Syntastic, but
|
Vim flickering. Attempts were made to resolve these issues in Syntastic, but
|
||||||
ultimately some of them failed (for various reasons).
|
ultimately some of them failed (for various reasons).
|
||||||
|
|
||||||
@ -2199,28 +2177,53 @@ we find the request to be reasonable, we'll find a way to address it.
|
|||||||
*youcompleteme-completion-doesnt-work-with-c-standard-library-headers*
|
*youcompleteme-completion-doesnt-work-with-c-standard-library-headers*
|
||||||
Completion doesn't work with the C++ standard library headers ~
|
Completion doesn't work with the C++ standard library headers ~
|
||||||
|
|
||||||
This is caused by an issue with libclang. Compiling from 'clang' the binary
|
This is caused by an issue with libclang that only affects some operating
|
||||||
uses the correct default header search paths but compiling from 'libclang.so'
|
systems. Compiling with 'clang' the binary will use the correct default header
|
||||||
does not. The issue seems to impact some OS's more than others. It appears that
|
search paths but compiling with 'libclang.so' (which YCM uses) does not.
|
||||||
OS X Mavericks in particular has problems with this.
|
|
||||||
|
|
||||||
The current workaround is to call 'echo | clang -v -E -x c++ -' and look at the
|
Mac OS X is normally affected, but there's a workaround in YCM for that
|
||||||
paths under the '#include <...> search starts here:' heading. You should take
|
specific OS. If you're not running that OS but still have the same problem,
|
||||||
those paths, prepend '-isystem' to each individual path and append them all to
|
continue reading.
|
||||||
the list of flags you return from your 'FlagsForFile' function in your
|
|
||||||
|
The workaround is to call 'echo | clang -v -E -x c++ -' and look at the paths
|
||||||
|
under the '#include <...> search starts here:' heading. You should take those
|
||||||
|
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.
|
'.ycm_extra_conf.py' file.
|
||||||
|
|
||||||
See issue #303 [34] for details.
|
See issue #303 [35] for details.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-install-ycm-with-neobundle-36*
|
||||||
|
Install YCM with NeoBundle [36] ~
|
||||||
|
|
||||||
|
NeoBundle [36] can do the compilation for you; just add the following to your
|
||||||
|
vimrc:
|
||||||
|
>
|
||||||
|
NeoBundle 'Valloric/YouCompleteMe', {
|
||||||
|
\ 'build' : {
|
||||||
|
\ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
|
||||||
|
\ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
|
||||||
|
\ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
|
||||||
|
\ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer'
|
||||||
|
\ }
|
||||||
|
\ }
|
||||||
|
<
|
||||||
|
But you could have problems with the time needed to get the sub modules and
|
||||||
|
compile the whole thing. To increase the Neobundle timeout to 1500 seconds, add
|
||||||
|
the following to your vimrc:
|
||||||
|
>
|
||||||
|
let g:neobundle#install_process_timeout = 1500
|
||||||
|
<
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-contact*
|
*youcompleteme-contact*
|
||||||
Contact ~
|
Contact ~
|
||||||
|
|
||||||
If you have questions about the plugin or need help, please use the ycm-users
|
If you have questions about the plugin or need help, please use the ycm-users
|
||||||
[32] mailing list.
|
[33] mailing list.
|
||||||
|
|
||||||
If you have bug reports or feature suggestions, please use the issue tracker
|
If you have bug reports or feature suggestions, please use the issue tracker
|
||||||
[35].
|
[37].
|
||||||
|
|
||||||
The latest version of the plugin is available at
|
The latest version of the plugin is available at
|
||||||
http://valloric.github.io/YouCompleteMe/.
|
http://valloric.github.io/YouCompleteMe/.
|
||||||
@ -2241,9 +2244,9 @@ anything to do with it.
|
|||||||
*youcompleteme-license*
|
*youcompleteme-license*
|
||||||
License ~
|
License ~
|
||||||
|
|
||||||
This software is licensed under the GPL v3 license [36]. © 2013 Google Inc.
|
This software is licensed under the GPL v3 license [38]. © 2013 Google Inc.
|
||||||
|
|
||||||
Image: Bitdeli Badge [37]
|
Image: Bitdeli Badge [39]
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-references*
|
*youcompleteme-references*
|
||||||
@ -2254,38 +2257,40 @@ References ~
|
|||||||
[3] http://clang.llvm.org/
|
[3] http://clang.llvm.org/
|
||||||
[4] https://github.com/davidhalter/jedi
|
[4] https://github.com/davidhalter/jedi
|
||||||
[5] https://github.com/nosami/OmniSharpServer
|
[5] https://github.com/nosami/OmniSharpServer
|
||||||
[6] http://i.imgur.com/0OP4ood.gif
|
[6] https://github.com/nsf/gocode
|
||||||
[7] http://en.wikipedia.org/wiki/Subsequence
|
[7] http://i.imgur.com/0OP4ood.gif
|
||||||
[8] https://github.com/scrooloose/syntastic
|
[8] http://en.wikipedia.org/wiki/Subsequence
|
||||||
[9] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
|
[9] https://github.com/scrooloose/syntastic
|
||||||
[10] http://code.google.com/p/macvim/#Download
|
[10] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
|
||||||
[11] https://github.com/gmarik/vundle#about
|
[11] http://code.google.com/p/macvim/#Download
|
||||||
[12] http://mxcl.github.com/homebrew/
|
[12] https://github.com/gmarik/vundle#about
|
||||||
[13] http://www.cmake.org/cmake/resources/software.html
|
[13] http://mxcl.github.com/homebrew/
|
||||||
[14] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
|
[14] http://www.cmake.org/cmake/resources/software.html
|
||||||
[15] https://github.com/Valloric/YouCompleteMe/wiki/Windows-Installation-Guide
|
[15] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
|
||||||
[16] https://github.com/tpope/vim-pathogen#pathogenvim
|
[16] https://github.com/Valloric/YouCompleteMe/wiki/Windows-Installation-Guide
|
||||||
[17] http://vimhelp.appspot.com/starting.txt.html#vimrc
|
[17] https://github.com/tpope/vim-pathogen#pathogenvim
|
||||||
[18] http://llvm.org/releases/download.html#3.3
|
[18] http://vimhelp.appspot.com/starting.txt.html#vimrc
|
||||||
[19] https://github.com/Valloric/YouCompleteMe#options
|
[19] http://llvm.org/releases/download.html#3.3
|
||||||
[20] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py
|
[20] https://github.com/Valloric/YouCompleteMe#options
|
||||||
[21] http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
[21] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py
|
||||||
[22] https://github.com/rizsotto/Bear
|
[22] http://clang.llvm.org/docs/JSONCompilationDatabase.html
|
||||||
[23] https://github.com/rdnetto/YCM-Generator
|
[23] https://github.com/rizsotto/Bear
|
||||||
[24] http://eclim.org/
|
[24] https://github.com/rdnetto/YCM-Generator
|
||||||
[25] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
|
[25] http://eclim.org/
|
||||||
[26] https://github.com/Valloric/ListToggle
|
[26] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
|
||||||
[27] http://ctags.sourceforge.net/FORMAT
|
[27] https://github.com/Valloric/ListToggle
|
||||||
[28] https://docs.python.org/2/library/re.html#regular-expression-syntax
|
[28] http://ctags.sourceforge.net/FORMAT
|
||||||
[29] https://github.com/Valloric/YouCompleteMe/issues/18
|
[29] https://docs.python.org/2/library/re.html#regular-expression-syntax
|
||||||
[30] http://ctags.sourceforge.net/
|
[30] https://github.com/Valloric/YouCompleteMe/issues/18
|
||||||
[31] https://github.com/Raimondi/delimitMate
|
[31] http://ctags.sourceforge.net/
|
||||||
[32] https://groups.google.com/forum/?hl=en#!forum/ycm-users
|
[32] https://github.com/Raimondi/delimitMate
|
||||||
[33] https://github.com/Valloric/YouCompleteMe/issues/593
|
[33] https://groups.google.com/forum/?hl=en#!forum/ycm-users
|
||||||
[34] https://github.com/Valloric/YouCompleteMe/issues/303
|
[34] https://github.com/Valloric/YouCompleteMe/issues/593
|
||||||
[35] https://github.com/Valloric/YouCompleteMe/issues?state=open
|
[35] https://github.com/Valloric/YouCompleteMe/issues/303
|
||||||
[36] http://www.gnu.org/copyleft/gpl.html
|
[36] https://github.com/Shougo/neobundle.vim
|
||||||
[37] https://bitdeli.com/free
|
[37] https://github.com/Valloric/YouCompleteMe/issues?state=open
|
||||||
[38] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png
|
[38] http://www.gnu.org/copyleft/gpl.html
|
||||||
|
[39] https://bitdeli.com/free
|
||||||
|
[40] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png
|
||||||
|
|
||||||
vim: ft=help
|
vim: ft=help
|
||||||
|
Loading…
Reference in New Issue
Block a user