Add Windows documentation

This commit is contained in:
micbou 2015-09-21 02:36:34 +02:00
parent 7bf39973c1
commit 2ace4eea88
2 changed files with 296 additions and 113 deletions

150
README.md
View File

@ -150,9 +150,10 @@ Compiling YCM **without** semantic support for C-family languages:
./install.py ./install.py
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. If you want Go support, you should add `--gocode-completer`. install script as well. If you want Go support, you should add
If you want semantic TypeScript support, install the TypeScript SDK with `--gocode-completer`. If you want semantic TypeScript support, install the
`npm install -g typescript` TypeScript SDK with `npm install -g typescript` (you'll need to install
[nodejs and npm][npm-install]).
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,
@ -195,9 +196,10 @@ Compiling YCM **without** semantic support for C-family languages:
./install.py ./install.py
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. If you want Go support, you should add `--gocode-completer`. install script as well. If you want Go support, you should add
If you want semantic TypeScript support, install the TypeScript SDK with `--gocode-completer`. If you want semantic TypeScript support, install the
`npm install -g typescript`. TypeScript SDK with `npm install -g typescript` (you'll need to install
[nodejs and npm][npm-install]).
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,
@ -210,9 +212,66 @@ 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 get Please refer to the full Installation Guide below; the following commands are
it to work there. See the [Windows Installation Guide][win-wiki] wiki page. Feel provided on a best-effort basis and may not work for you.
free to add to it.
**Important:** we assume that you are using the `cmd.exe` command prompt and
that you know how to add an executable to the PATH environment variable.
Make sure you have at least Vim 7.3.598 with python2 support. You can check the
version by typing `:version` inside Vim. Take note of the Vim architecture, i.e.
32 or 64-bit. It will be important when choosing the python2 installer. We
recommend using a 64-bit client. Don't worry, [a frequently updated copy of
64-bit Vim][vim64-win-download] is available.
Install YouCompleteMe with [Vundle][].
**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
rarely), YCM will notify you to recompile it. You should then rerun the install
process.
Download and install the following software:
- [python2][python-win-download]. Be sure to pick the version corresponding to
your Vim architecture. It is _Windows x86-64 MSI installer_ if you are using the
Vim previously linked.
- [CMake][cmake-download]. Add CMake executable to the PATH environment
variable.
- [Visual Studio][visual-studio-download]. Download the community edition.
During setup, choose _Custom_ as the installation type and select the _Visual
C++_ component.
- [7-zip][7z-download]. Required to build YCM with semantic support for
C-family languages.
Compiling YCM **with** semantic support for C-family languages:
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
install.py --clang-completer
Compiling YCM **without** semantic support for C-family languages:
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
install.py
If you want semantic C# support, you should add `--omnisharp-completer` to the
install script as well. If you want Go support, you should add
`--gocode-completer`. If you want semantic TypeScript support, install the
TypeScript SDK with `npm install -g typescript` (you'll need to install
[nodejs and npm][npm-install]).
You can specify the Microsoft Visual C++ (MSVC) version using the `--msvc`
option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14
(2015).
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,
you will need to provide the compilation flags for your project to YCM. It's all
in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
### FreeBSD/OpenBSD Installation ### FreeBSD/OpenBSD Installation
@ -263,11 +322,13 @@ that are conservatively turned off by default that you may want to turn on.
### Full Installation Guide ### Full Installation Guide
These are the steps necessary to get YCM working on a Unix OS like Linux or These are the steps necessary to get YCM working on a Unix OS and on Windows.
Mac OS X. My apologies to Windows users, but I don't have a guide for them. The
code is platform agnostic, so if everything is configured correctly, YCM **Note to Windows users:** we assume that you are running the `cmd.exe` command
_should_ work on Windows without issues (but as of writing, it's untested on prompt and that the needed executables are in the PATH environment variable. Do
that platform). not just copy the shell commands. Replace `~` by `%USERPROFILE%` in them and use
the right Vim home directory. It should be `vimfiles` by default instead of
`.vim`.
See the _FAQ_ if you have any issues. See the _FAQ_ if you have any issues.
@ -294,6 +355,10 @@ process.
Vim: `:echo has('python')`. The output should be 1. If it's 0, then get a Vim: `:echo has('python')`. The output should be 1. If it's 0, then get a
version of Vim with Python support. version of Vim with Python support.
On Windows, check also if your Vim architecture is 32 or 64-bit. This is
critical because it must match the python2 and the YCM libraries
architectures. We recommend using a 64-bit Vim.
2. **Install YCM** with [Vundle][] (or [Pathogen][], but Vundle is a better 2. **Install YCM** with [Vundle][] (or [Pathogen][], but Vundle is a better
idea). With Vundle, this would mean adding a `Plugin idea). With Vundle, this would mean adding a `Plugin
'Valloric/YouCompleteMe'` line to your [vimrc][]. 'Valloric/YouCompleteMe'` line to your [vimrc][].
@ -329,10 +394,16 @@ process.
install][cmake-download] cmake from its project site. Mac users can also get install][cmake-download] cmake from its project site. Mac users can also get
it through [Homebrew][brew] with `brew install cmake`. it through [Homebrew][brew] with `brew install cmake`.
You also need to make sure you have Python headers installed. On a On a Unix OS, you need to make sure you have Python headers installed. On a
Debian-like Linux distro, this would be `sudo apt-get install python-dev`. Debian-like Linux distro, this would be `sudo apt-get install python-dev`.
On Mac they should already be present. On Mac they should already be present.
On Windows, you need to download and install [python2][python-win-download].
Pick the version corresponding to your Vim architecture. You will also need
Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by installing
[Visual Studio][visual-studio-download]. MSVC 11 (Visual Studio 2012), 12
(2013), and 14 (2015) are officially supported.
Here we'll assume you installed YCM with Vundle. That means that the Here we'll assume you installed YCM with Vundle. That means that the
top-level YCM directory is in `~/.vim/bundle/YouCompleteMe`. top-level YCM directory is in `~/.vim/bundle/YouCompleteMe`.
@ -347,7 +418,17 @@ process.
support for C-family languages, run the following command in the `ycm_build` support for C-family languages, run the following command in the `ycm_build`
directory: directory:
cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp cmake -G "<generator>" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
where `<generator>` is `Unix Makefiles` on Unix systems and one of the
following Visual Studio generators on Windows:
- `Visual Studio 11 2012 Win64`
- `Visual Studio 12 2013 Win64`
- `Visual Studio 14 2015 Win64`
Remove the `Win64` part in these generators if your Vim architecture is
32-bit.
For those who want to use the system version of boost, you would pass For those who want to use the system version of boost, you would pass
`-DUSE_SYSTEM_BOOST=ON` to cmake. This may be necessary on some systems `-DUSE_SYSTEM_BOOST=ON` to cmake. This may be necessary on some systems
@ -361,7 +442,8 @@ process.
`cmake` call will be a bit more complicated. We'll assume you downloaded a `cmake` call will be a bit more complicated. We'll assume you downloaded a
binary distribution of LLVM+Clang from llvm.org in step 3 and that you binary distribution of LLVM+Clang from llvm.org in step 3 and that you
extracted the archive file to folder `~/ycm_temp/llvm_root_dir` (with `bin`, extracted the archive file to folder `~/ycm_temp/llvm_root_dir` (with `bin`,
`lib`, `include` etc. folders right inside that folder). `lib`, `include` etc. folders right inside that folder). On Windows, you can
extract the files from the LLVM+Clang installer using [7-zip][7z-download].
NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a
custom-built LLVM! See docs below for `EXTERNAL_LIBCLANG_PATH` when using a custom-built LLVM! See docs below for `EXTERNAL_LIBCLANG_PATH` when using a
@ -369,11 +451,17 @@ process.
With that in mind, run the following command in the `ycm_build` directory: With that in mind, run the following command in the `ycm_build` directory:
cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
Now that makefiles have been generated, simply run: where `<generator>` is replaced like above.
make ycm_support_libs Now that configuration files have been generated, compile the libraries
using this command:
cmake --build . --target ycm_support_libs --config Release
The `--config Release` part is specific to Windows and will be ignored on a
Unix OS.
For those who want to use the system version of libclang, you would pass For those who want to use the system version of libclang, you would pass
`-DUSE_SYSTEM_LIBCLANG=ON` to cmake _instead of_ the `-DUSE_SYSTEM_LIBCLANG=ON` to cmake _instead of_ the
@ -389,9 +477,9 @@ process.
other flags. **If you compiled LLVM from source, this is the flag you should other flags. **If you compiled LLVM from source, this is the flag you should
be using.** be using.**
Running the `make` command will also place the `libclang.[so|dylib]` in the Running the `make` command will also place the `libclang.[so|dylib|dll]` in
`YouCompleteMe/third_party/ycmd` folder for you if you compiled with clang the `YouCompleteMe/third_party/ycmd` folder for you if you compiled with
support (it needs to be there for YCM to work). clang support (it needs to be there for YCM to work).
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,
@ -2156,10 +2244,10 @@ See [issue #303][issue-303] for details.
```viml ```viml
NeoBundle 'Valloric/YouCompleteMe', { NeoBundle 'Valloric/YouCompleteMe', {
\ 'build' : { \ 'build' : {
\ 'mac' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'mac' : './install.py',
\ 'unix' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'unix' : './install.py',
\ 'windows' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'windows' : 'install.py',
\ 'cygwin' : './install.py --clang-completer --system-libclang --omnisharp-completer' \ 'cygwin' : './install.py'
\ } \ }
\ } \ }
``` ```
@ -2195,7 +2283,7 @@ This software is licensed under the [GPL v3 license][gpl].
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[Clang]: http://clang.llvm.org/ [Clang]: http://clang.llvm.org/
[vundle]: https://github.com/gmarik/vundle#about [vundle]: https://github.com/VundleVim/Vundle.vim#about
[pathogen]: https://github.com/tpope/vim-pathogen#pathogenvim [pathogen]: https://github.com/tpope/vim-pathogen#pathogenvim
[clang-download]: http://llvm.org/releases/download.html [clang-download]: http://llvm.org/releases/download.html
[brew]: http://mxcl.github.com/homebrew/ [brew]: http://mxcl.github.com/homebrew/
@ -2214,7 +2302,6 @@ This software is licensed under the [GPL v3 license][gpl].
[issue18]: https://github.com/Valloric/YouCompleteMe/issues/18 [issue18]: https://github.com/Valloric/YouCompleteMe/issues/18
[delimitMate]: https://github.com/Raimondi/delimitMate [delimitMate]: https://github.com/Raimondi/delimitMate
[completer-api]: https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py [completer-api]: https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
[win-wiki]: https://github.com/Valloric/YouCompleteMe/wiki/Windows-Installation-Guide
[eclim]: http://eclim.org/ [eclim]: http://eclim.org/
[jedi]: https://github.com/davidhalter/jedi [jedi]: https://github.com/davidhalter/jedi
[ultisnips]: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt [ultisnips]: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
@ -2234,3 +2321,8 @@ This software is licensed under the [GPL v3 license][gpl].
[Gocode]: https://github.com/nsf/gocode [Gocode]: https://github.com/nsf/gocode
[TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server [TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server
[NeoBundle]: https://github.com/Shougo/neobundle.vim [NeoBundle]: https://github.com/Shougo/neobundle.vim
[vim64-win-download]: https://bintray.com/veegee/generic/vim_x64
[python-win-download]: https://www.python.org/downloads/windows/
[visual-studio-download]: https://www.visualstudio.com/products/free-developer-offers-vs.aspx
[7z-download]: http://www.7-zip.org/download.html
[npm-install]: https://docs.npmjs.com/getting-started/installing-node

View File

@ -127,7 +127,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 [39] |youcompleteme-install-ycm-with-neobundle-39| 28. Install YCM with NeoBundle [43] |youcompleteme-install-ycm-with-neobundle-43|
10. Contact |youcompleteme-contact| 10. Contact |youcompleteme-contact|
11. License |youcompleteme-license| 11. License |youcompleteme-license|
12. References |youcompleteme-references| 12. References |youcompleteme-references|
@ -303,7 +303,7 @@ Compiling YCM **without** semantic support for C-family languages:
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. If you want Go support, you should add '--gocode- install script as well. If you want Go support, you should add '--gocode-
completer'. If you want semantic TypeScript support, install the TypeScript SDK completer'. If you want semantic TypeScript support, install the TypeScript SDK
with 'npm install -g typescript' with 'npm install -g typescript' (you'll need to install nodejs and npm [18]).
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,
@ -324,7 +324,7 @@ provided on a best-effort basis and may not work for you.
Make sure you have Vim 7.3.598 with python2 support. Ubuntu 14.04 and later Make sure you have Vim 7.3.598 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 [18] (don't worry, it's easy). from source [19] (don't worry, it's easy).
Install YouCompleteMe with Vundle [15]. Install YouCompleteMe with Vundle [15].
@ -351,7 +351,7 @@ Compiling YCM **without** semantic support for C-family languages:
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. If you want Go support, you should add '--gocode- install script as well. If you want Go support, you should add '--gocode-
completer'. If you want semantic TypeScript support, install the TypeScript SDK completer'. If you want semantic TypeScript support, install the TypeScript SDK
with 'npm install -g typescript'. with 'npm install -g typescript' (you'll need to install nodejs and npm [18]).
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,
@ -366,9 +366,66 @@ that are conservatively turned off by default that you may want to turn on.
*youcompleteme-windows-installation* *youcompleteme-windows-installation*
Windows Installation ~ Windows Installation ~
YCM has **no official support for Windows**, but that doesn't mean you can't Please refer to the full Installation Guide below; the following commands are
get it to work there. See the Windows Installation Guide [19] wiki page. Feel provided on a best-effort basis and may not work for you.
free to add to it.
**Important:** we assume that you are using the 'cmd.exe' command prompt and
that you know how to add an executable to the PATH environment variable.
Make sure you have at least Vim 7.3.598 with python2 support. You can check the
version by typing ':version' inside Vim. Take note of the Vim architecture,
i.e. 32 or 64-bit. It will be important when choosing the python2 installer. We
recommend using a 64-bit client. Don't worry, a frequently updated copy of
64-bit Vim [20] is available.
Install YouCompleteMe with Vundle [15].
**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
rarely), YCM will notify you to recompile it. You should then rerun the install
process.
Download and install the following software:
- python2 [21]. Be sure to pick the version corresponding to your Vim
architecture. It is _Windows x86-64 MSI installer_ if you are using the Vim
previously linked.
- CMake [17]. Add CMake executable to the PATH environment variable.
- Visual Studio [22]. Download the community edition. During setup, choose
_Custom_ as the installation type and select the _Visual C++_ component.
- 7-zip [23]. Required to build YCM with semantic support for C-family
languages.
Compiling YCM **with** semantic support for C-family languages:
>
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
install.py --clang-completer
<
Compiling YCM **without** semantic support for C-family languages:
>
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
install.py
<
If you want semantic C# support, you should add '--omnisharp-completer' to the
install script as well. If you want Go support, you should add '--gocode-
completer'. If you want semantic TypeScript support, install the TypeScript SDK
with 'npm install -g typescript' (you'll need to install nodejs and npm [18]).
You can specify the Microsoft Visual C++ (MSVC) version using the '--msvc'
option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14
(2015).
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,
you will need to provide the compilation flags for your project to YCM. It's
all in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
*youcompleteme-freebsd-openbsd-installation* *youcompleteme-freebsd-openbsd-installation*
@ -424,11 +481,13 @@ that are conservatively turned off by default that you may want to turn on.
*youcompleteme-full-installation-guide* *youcompleteme-full-installation-guide*
Full Installation Guide ~ Full Installation Guide ~
These are the steps necessary to get YCM working on a Unix OS like Linux or Mac These are the steps necessary to get YCM working on a Unix OS and on Windows.
OS X. My apologies to Windows users, but I don't have a guide for them. The
code is platform agnostic, so if everything is configured correctly, YCM **Note to Windows users:** we assume that you are running the 'cmd.exe' command
_should_ work on Windows without issues (but as of writing, it's untested on prompt and that the needed executables are in the PATH environment variable. Do
that platform). not just copy the shell commands. Replace '~' by '%USERPROFILE%' in them and
use the right Vim home directory. It should be 'vimfiles' by default instead of
'.vim'.
See the _FAQ_ if you have any issues. See the _FAQ_ if you have any issues.
@ -449,15 +508,19 @@ process.
1-Z', where Z will be some number. That number needs to be 598 or higher. 1-Z', where Z will be some number. That number needs to be 598 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 [18] (don't worry, it's easy). from source [19] (don't worry, it's easy).
After you have made sure that you have Vim 7.3.598+, type the following After you have made sure that you have Vim 7.3.598+, 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 [15] (or Pathogen [20], but Vundle is a On Windows, check also if your Vim architecture is 32 or 64-bit. This is
critical because it must match the python2 and the YCM libraries
architectures. We recommend using a 64-bit Vim.
2. **Install YCM** with Vundle [15] (or Pathogen [24], 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 [21]. 'Valloric/YouCompleteMe'" line to your vimrc [25].
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
@ -474,7 +537,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 [22] if at all possible. Make sure you official binaries from llvm.org [26] 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
@ -490,10 +553,16 @@ process.
download and install [17] cmake from its project site. Mac users can also download and install [17] cmake from its project site. Mac users can also
get it through Homebrew [16] with 'brew install cmake'. get it through Homebrew [16] with 'brew install cmake'.
You also need to make sure you have Python headers installed. On a On a Unix OS, you need to make sure you have Python headers installed. On
Debian-like Linux distro, this would be 'sudo apt-get install python- a Debian-like Linux distro, this would be 'sudo apt-get install python-
dev'. On Mac they should already be present. dev'. On Mac they should already be present.
On Windows, you need to download and install python2 [21]. Pick the
version corresponding to your Vim architecture. You will also need
Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by installing
Visual Studio [22]. MSVC 11 (Visual Studio 2012), 12 (2013), and 14
(2015) are officially supported.
Here we'll assume you installed YCM with Vundle. That means that the top- Here we'll assume you installed YCM with Vundle. That means that the top-
level YCM directory is in '~/.vim/bundle/YouCompleteMe'. level YCM directory is in '~/.vim/bundle/YouCompleteMe'.
@ -508,8 +577,18 @@ process.
support for C-family languages, run the following command in the support for C-family languages, run the following command in the
'ycm_build' directory: 'ycm_build' directory:
> >
cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp cmake -G "<generator>" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
< <
where '<generator>' is 'Unix Makefiles' on Unix systems and one of the
following Visual Studio generators on Windows:
- 'Visual Studio 11 2012 Win64'
- 'Visual Studio 12 2013 Win64'
- 'Visual Studio 14 2015 Win64'
Remove the 'Win64' part in these generators if your Vim architecture is
32-bit.
For those who want to use the system version of boost, you would pass For those who want to use the system version of boost, you would pass
'-DUSE_SYSTEM_BOOST=ON' to cmake. This may be necessary on some systems '-DUSE_SYSTEM_BOOST=ON' to cmake. This may be necessary on some systems
where the bundled version of boost doesn't compile out of the box. where the bundled version of boost doesn't compile out of the box.
@ -522,7 +601,9 @@ process.
'cmake' call will be a bit more complicated. We'll assume you downloaded 'cmake' call will be a bit more complicated. We'll assume you downloaded
a binary distribution of LLVM+Clang from llvm.org in step 3 and that you a binary distribution of LLVM+Clang from llvm.org in step 3 and that you
extracted the archive file to folder '~/ycm_temp/llvm_root_dir' (with extracted the archive file to folder '~/ycm_temp/llvm_root_dir' (with
'bin', 'lib', 'include' etc. folders right inside that folder). 'bin', 'lib', 'include' etc. folders right inside that folder). On
Windows, you can extract the files from the LLVM+Clang installer using
7-zip [23].
NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a
custom-built LLVM! See docs below for 'EXTERNAL_LIBCLANG_PATH' when using custom-built LLVM! See docs below for 'EXTERNAL_LIBCLANG_PATH' when using
@ -531,12 +612,18 @@ process.
With that in mind, run the following command in the 'ycm_build' With that in mind, run the following command in the 'ycm_build'
directory: directory:
> >
cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
< <
Now that makefiles have been generated, simply run: where '<generator>' is replaced like above.
Now that configuration files have been generated, compile the libraries
using this command:
> >
make ycm_support_libs cmake --build . --target ycm_support_libs --config Release
< <
The '--config Release' part is specific to Windows and will be ignored on
a Unix OS.
For those who want to use the system version of libclang, you would pass For those who want to use the system version of libclang, you would pass
'-DUSE_SYSTEM_LIBCLANG=ON' to cmake _instead of_ the '-DUSE_SYSTEM_LIBCLANG=ON' to cmake _instead of_ the
'-DPATH_TO_LLVM_ROOT=...' flag. '-DPATH_TO_LLVM_ROOT=...' flag.
@ -551,9 +638,9 @@ process.
the other flags. **If you compiled LLVM from source, this is the flag you the other flags. **If you compiled LLVM from source, this is the flag you
should be using.** should be using.**
Running the 'make' command will also place the 'libclang.[so|dylib]' in Running the 'make' command will also place the 'libclang.[so|dylib|dll]'
the 'YouCompleteMe/third_party/ycmd' folder for you if you compiled with in the 'YouCompleteMe/third_party/ycmd' folder for you if you compiled
clang support (it needs to be there for YCM to work). with clang support (it needs to be there for YCM to work).
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,
@ -647,7 +734,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 [23]_ section below. it to Vim. You can remap the keys; see the _Options [27]_ 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
@ -718,20 +805,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' [24] for details on how this works. You See YCM's own '.ycm_extra_conf.py' [28] 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 [25] is also supported. Again, see Yes, Clang's 'CompilationDatabase' system [29] 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 [26] to generate the 'compile_commands.json' file. use something like Bear [30] to generate the 'compile_commands.json' file.
Consider using YCM-Generator [27] to generate the 'ycm_extra_conf.py' file. Consider using YCM-Generator [31] 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
@ -758,7 +845,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 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 [28]. Just make sure You can get stellar omnifuncs for Java and Ruby with Eclim [32]. 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.*').
@ -776,7 +863,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 [29]. YCM using the Completer API [33].
Here are the differences between the two approaches: Here are the differences between the two approaches:
@ -795,7 +882,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 [29]. complete-functions'. For the Completer API, see the API docs [33].
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.
@ -846,7 +933,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 [30] (which also makes it another (very small) Vim plugin called ListToggle [34] (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.
@ -1197,11 +1284,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 [21] by including a line like this: vimrc script [25] 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 [21] you have to Note that after changing an option in your vimrc script [25] you have to
restart Vim for the changes to take effect. restart Vim for the changes to take effect.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -1522,7 +1609,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 [31]. The format The only supported tag format is the Exuberant Ctags format [35]. 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.
@ -1900,7 +1987,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 [32]. NOTE: The regex syntax is **NOT** Vim's, it's Python's [36].
Default: '[see next line]' Default: '[see next line]'
> >
@ -2093,7 +2180,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 [33] for suggestions. then. If you still get problems with this, see issue #18 [37] for suggestions.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
*youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files* *youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files*
@ -2178,8 +2265,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 [34] to produce your tags files since Make sure you are using Exuberant Ctags [38] to produce your tags files since
the only supported tag format is the Exuberant Ctags format [31]. The format the only supported tag format is the Exuberant Ctags format [35]. 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".
@ -2253,7 +2340,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 [35] plugin instead. It does the same thing without Use the delimitMate [39] plugin instead. It does the same thing without
conflicting with YCM. conflicting with YCM.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -2261,7 +2348,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
[36] mailing list, _don't_ create issues on the tracker. The tracker is for bug [40] mailing list, _don't_ create issues on the tracker. The tracker is for bug
reports and feature requests. reports and feature requests.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -2315,7 +2402,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 [37]) and other problems, like random Syntastic-Vim interactions (issue #593 [41]) 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).
@ -2351,21 +2438,21 @@ paths, prepend '-isystem' to each individual path and append them all to the
list of flags you return from your 'FlagsForFile' function in your list of flags you return from your 'FlagsForFile' function in your
'.ycm_extra_conf.py' file. '.ycm_extra_conf.py' file.
See issue #303 [38] for details. See issue #303 [42] for details.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
*youcompleteme-install-ycm-with-neobundle-39* *youcompleteme-install-ycm-with-neobundle-43*
Install YCM with NeoBundle [39] ~ Install YCM with NeoBundle [43] ~
NeoBundle [39] can do the compilation for you; just add the following to your NeoBundle [43] can do the compilation for you; just add the following to your
vimrc: vimrc:
> >
NeoBundle 'Valloric/YouCompleteMe', { NeoBundle 'Valloric/YouCompleteMe', {
\ 'build' : { \ 'build' : {
\ 'mac' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'mac' : './install.py',
\ 'unix' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'unix' : './install.py',
\ 'windows' : './install.py --clang-completer --system-libclang --omnisharp-completer', \ 'windows' : 'install.py',
\ 'cygwin' : './install.py --clang-completer --system-libclang --omnisharp-completer' \ 'cygwin' : './install.py'
\ } \ }
\ } \ }
< <
@ -2380,10 +2467,10 @@ the following to your vimrc:
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
[36] mailing list. [40] 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
[40]. [44].
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/.
@ -2394,10 +2481,10 @@ The author's homepage is http://val.markovic.io.
*youcompleteme-license* *youcompleteme-license*
License ~ License ~
This software is licensed under the GPL v3 license [41]. © 2015 YouCompleteMe This software is licensed under the GPL v3 license [45]. © 2015 YouCompleteMe
contributors contributors
Image: Bitdeli Badge [42] Image: Bitdeli Badge [46]
=============================================================================== ===============================================================================
*youcompleteme-references* *youcompleteme-references*
@ -2417,34 +2504,38 @@ References ~
[12] https://github.com/scrooloose/syntastic [12] https://github.com/scrooloose/syntastic
[13] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt [13] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
[14] https://github.com/macvim-dev/macvim/releases [14] https://github.com/macvim-dev/macvim/releases
[15] https://github.com/gmarik/vundle#about [15] https://github.com/VundleVim/Vundle.vim#about
[16] http://mxcl.github.com/homebrew/ [16] http://mxcl.github.com/homebrew/
[17] http://www.cmake.org/cmake/resources/software.html [17] http://www.cmake.org/cmake/resources/software.html
[18] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source [18] https://docs.npmjs.com/getting-started/installing-node
[19] https://github.com/Valloric/YouCompleteMe/wiki/Windows-Installation-Guide [19] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
[20] https://github.com/tpope/vim-pathogen#pathogenvim [20] https://bintray.com/veegee/generic/vim_x64
[21] http://vimhelp.appspot.com/starting.txt.html#vimrc [21] https://www.python.org/downloads/windows/
[22] http://llvm.org/releases/download.html [22] https://www.visualstudio.com/products/free-developer-offers-vs.aspx
[23] https://github.com/Valloric/YouCompleteMe#options [23] http://www.7-zip.org/download.html
[24] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py [24] https://github.com/tpope/vim-pathogen#pathogenvim
[25] http://clang.llvm.org/docs/JSONCompilationDatabase.html [25] http://vimhelp.appspot.com/starting.txt.html#vimrc
[26] https://github.com/rizsotto/Bear [26] http://llvm.org/releases/download.html
[27] https://github.com/rdnetto/YCM-Generator [27] https://github.com/Valloric/YouCompleteMe#options
[28] http://eclim.org/ [28] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py
[29] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py [29] http://clang.llvm.org/docs/JSONCompilationDatabase.html
[30] https://github.com/Valloric/ListToggle [30] https://github.com/rizsotto/Bear
[31] http://ctags.sourceforge.net/FORMAT [31] https://github.com/rdnetto/YCM-Generator
[32] https://docs.python.org/2/library/re.html#regular-expression-syntax [32] http://eclim.org/
[33] https://github.com/Valloric/YouCompleteMe/issues/18 [33] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
[34] http://ctags.sourceforge.net/ [34] https://github.com/Valloric/ListToggle
[35] https://github.com/Raimondi/delimitMate [35] http://ctags.sourceforge.net/FORMAT
[36] https://groups.google.com/forum/?hl=en#!forum/ycm-users [36] https://docs.python.org/2/library/re.html#regular-expression-syntax
[37] https://github.com/Valloric/YouCompleteMe/issues/593 [37] https://github.com/Valloric/YouCompleteMe/issues/18
[38] https://github.com/Valloric/YouCompleteMe/issues/303 [38] http://ctags.sourceforge.net/
[39] https://github.com/Shougo/neobundle.vim [39] https://github.com/Raimondi/delimitMate
[40] https://github.com/Valloric/YouCompleteMe/issues?state=open [40] https://groups.google.com/forum/?hl=en#!forum/ycm-users
[41] http://www.gnu.org/copyleft/gpl.html [41] https://github.com/Valloric/YouCompleteMe/issues/593
[42] https://bitdeli.com/free [42] https://github.com/Valloric/YouCompleteMe/issues/303
[43] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png [43] https://github.com/Shougo/neobundle.vim
[44] https://github.com/Valloric/YouCompleteMe/issues?state=open
[45] http://www.gnu.org/copyleft/gpl.html
[46] https://bitdeli.com/free
[47] https://d2weczhvl823v0.cloudfront.net/Valloric/youcompleteme/trend.png
vim: ft=help vim: ft=help