YouCompleteMe 0,8,34,0,7,28,0,24

A code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim

Gitter Room Build Status Build status Coverage Status

Intro

YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for [Vim][]. It has several completion engines:

  • an identifier-based engine that works with every programming language,
  • a [Clang][]-based engine that provides native semantic code completion for C/C++/Objective-C/Objective-C++ (from now on referred to as "the C-family languages"),
  • a [Jedi][]-based completion engine for Python 2 and 3 (using the [JediHTTP][] wrapper),
  • an [OmniSharp][]-based completion engine for C#,
  • a combination of [Gocode][] and [Godef][] semantic engines for Go,
  • a [TSServer][]-based completion engine for TypeScript,
  • a [Tern][]-based completion engine for JavaScript,
  • a [racer][]-based completion engine for Rust,
  • and an omnifunc-based completer that uses data from Vim's omnicomplete system to provide semantic completions for many other languages (Ruby, PHP etc.).

YouCompleteMe GIF demo

Here's an explanation of what happens in the short GIF demo above.

First, realize that no keyboard shortcuts had to be pressed to get the list of completion candidates at any point in the demo. The user just types and the suggestions pop up by themselves. If the user doesn't find the completion suggestions relevant and/or just wants to type, they can do so; the completion engine will not interfere.

When the user sees a useful completion string being offered, they press the TAB key to accept it. This inserts the completion string. Repeated presses of the TAB key cycle through the offered completions.

If the offered completions are not relevant enough, the user can continue typing to further filter out unwanted completions.

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 input needs to be a [subsequence][] match of a completion. This is a fancy 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 subsequence of xaybgc, but not of xbyxaxxc. After the filter, a complicated sorting system ranks the completion strings so that the most relevant ones rise to the top of the menu (so you usually need to press TAB just once).

All of the above works with any programming language because of the identifier-based completion engine. It collects all of the identifiers in the current file and other files you visit (and your tags files) and searches them when you type (identifiers are put into per-filetype groups).

The demo also shows the semantic engine in use. When the user presses ., -> or :: while typing in insert mode (for C++; different triggers are used for other languages), the semantic engine is triggered (it can also be triggered 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 features (the little red X that shows up in the left gutter; inspired by [Syntastic][]) 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 don't need to save your file or press any keyboard shortcut to trigger this, it "just happens" in the background.

In essence, YCM obsoletes the following Vim plugins because it has all of their features plus extra:

  • clang_complete
  • AutoComplPop
  • Supertab
  • neocomplcache

And that's not all...

YCM also provides semantic IDE-like features in a number of languages, including:

  • finding declarations, definitions, usages, etc. of identifiers,
  • displaying type information for classes, variables, functions etc.,
  • displaying documentation for methods, members, etc. in the preview window,
  • fixing common coding errors, like missing semi-colons, typos, etc.,
  • semantic renaming of variables across files (JavaScript only).

Features vary by file type, so make sure to check out the file type feature summary and the full list of completer subcommands to find out what's available for your favourite languages.

You'll also find that YCM has filepath completers (try typing ./ in a file) and a completer that integrates with [UltiSnips][].

Installation

Mac OS X

These instructions (using install.py) are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide.

Install the latest version of [MacVim][]. Yes, MacVim. And yes, the latest.

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 it works correctly copy the mvim script from the [MacVim][] download to your local binary folder (for example /usr/local/bin/mvim) and then symlink it:

ln -s /usr/local/bin/mvim vim

Install YouCompleteMe with [Vundle][].

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

NOTE: If you want C-family completion, you MUST have the latest Xcode installed along with the latest Command Line Tools (they are installed automatically when you run clang for the first time, or manually by running xcode-select --install)

Install CMake. Preferably with [Homebrew][brew], but here's the [stand-alone CMake installer][cmake-download].

If you have installed a Homebrew Python and/or Homebrew MacVim, see the FAQ for details.

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py

The following additional language support options are available:

  • C# support: install Mono with [Homebrew][brew] or by downloading the [Mono Mac package][mono-install-osx] and add --omnisharp-completer when calling ./install.py.
  • Go support: install [Go][go-install] and add --gocode-completer when calling ./install.py.
  • TypeScript support: install [Node.js and npm][npm-install] then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install [Node.js and npm][npm-install] and add --tern-completer when calling ./install.py.
  • Rust support: install [Rust][rust-install] and add --racer-completer when calling ./install.py.

To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, rustc, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all

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.

Ubuntu Linux x64

These instructions (using install.py) are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide.

Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support. Ubuntu 16.04 and later 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 from source][vim-build] (don't worry, it's easy).

Install YouCompleteMe with [Vundle][].

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

Install development tools and CMake:

sudo apt-get install build-essential cmake

Make sure you have Python headers installed:

sudo apt-get install python-dev python3-dev

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py

The following additional language support options are available:

  • C# support: install [Mono][mono-install-ubuntu] and add --omnisharp-completer when calling ./install.py.
  • Go support: install [Go][go-install] and add --gocode-completer when calling ./install.py.
  • TypeScript support: install [Node.js and npm][npm-install] then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install [Node.js and npm][npm-install] and add --tern-completer when calling ./install.py.
  • Rust support: install [Rust][rust-install] and add --racer-completer when calling ./install.py.

To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, rustc, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all

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.

Fedora Linux x64

These instructions (using install.py) are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide.

Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support. Fedora 21 and later 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 from source][vim-build] (don't worry, it's easy).

Install YouCompleteMe with [Vundle][].

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

Install development tools and CMake:

sudo dnf install automake gcc gcc-c++ kernel-devel cmake

Make sure you have Python headers installed:

sudo dnf install python-devel python3-devel

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py

The following additional language support options are available:

  • C# support: install [Mono][mono-install-fedora] and add --omnisharp-completer when calling ./install.py.
  • Go support: install [Go][go-install] and add --gocode-completer when calling ./install.py.
  • TypeScript support: install [Node.js and npm][npm-install] then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install [Node.js and npm][npm-install] and add --tern-completer when calling ./install.py.
  • Rust support: install [Rust][rust-install] and add --racer-completer when calling ./install.py.

To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, rustc, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all

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.

Windows

These instructions (using install.py) are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide.

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.4.1578 with Python 2 or Python 3 support. You can check the version and which Python is supported by typing :version inside Vim. Look at the features included: +python/dyn for Python 2 and +python3/dyn for Python 3. Take note of the Vim architecture, i.e. 32 or 64-bit. It will be important when choosing the Python installer. We recommend using a 64-bit client. [Daily updated copies of 32-bit and 64-bit Vim with Python 2 and Python 3 support][vim-win-download] are available.

Add the line:

set encoding=utf-8

to your [vimrc][] if not already present. This option is required by YCM. Note that it does not prevent you from editing a file in another encoding than UTF-8. You can do that by specifying [the ++enc argument][++enc] to the :e command.

Install YouCompleteMe with [Vundle][].

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core 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:

  • [Python 2 or Python 3][python-win-download]. Be sure to pick the version corresponding to your Vim architecture. It is Windows x86 for a 32-bit Vim and Windows x86-64 for a 64-bit Vim. We recommend installing Python 3.
  • [CMake][cmake-download]. Add CMake executable to the PATH environment variable.
  • [Visual Studio][visual-studio-download]. Download the community edition. During setup, select Desktop development with C++ in Workloads.
  • [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

The following additional language support options are available:

  • C# support: add --omnisharp-completer when calling install.py. Be sure that [the build utility msbuild is in your PATH][add-msbuild-to-path].
  • Go support: install [Go][go-install] and add --gocode-completer when calling install.py.
  • TypeScript support: install [Node.js and npm][npm-install] then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install [Node.js and npm][npm-install] and add --tern-completer when calling install.py.
  • Rust support: install [Rust][rust-install] and add --racer-completer when calling install.py.

To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure msbuild, go, tsserver, node, npm, and cargo tools are installed and in your PATH, then simply run:

cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
python install.py --all

You can specify the Microsoft Visual C++ (MSVC) version using the --msvc option. YCM officially supports MSVC 12 (Visual Studio 2013), 14 (2015), and 15 (2017).

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

These instructions (using install.py) are the quickest way to install YouCompleteMe, however they may not work for everyone. If the following instructions don't work for you, check out the full installation guide.

NOTE: OpenBSD / FreeBSD are not officially supported platforms by YCM.

Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support.

OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version of Vim installed by running vim --version.

FreeBSD 10.x comes with clang compiler but not the libraries needed to install.

pkg install llvm38 boost-all boost-python-libs clang38
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/llvm38/lib/

Install YouCompleteMe with [Vundle][].

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

Install dependencies and CMake: sudo pkg_add llvm boost cmake

Compiling YCM with semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer --system-libclang --system-boost

Compiling YCM without semantic support for C-family languages:

cd ~/.vim/bundle/YouCompleteMe
./install.py --system-boost

The following additional language support options are available:

  • C# support: install Mono and add --omnisharp-completer when calling ./install.py.
  • Go support: install [Go][go-install] and add --gocode-completer when calling ./install.py.
  • TypeScript support: install [Node.js and npm][npm-install] then install the TypeScript SDK with npm install -g typescript.
  • JavaScript support: install [Node.js and npm][npm-install] and add --tern-completer when calling ./install.py.
  • Rust support: install [Rust][rust-install] and add --racer-completer when calling ./install.py.

To simply compile with everything enabled, there's a --all flag. So, to install with all language features, ensure xbuild, go, tsserver, node, npm, and cargo tools are installed and in your PATH, then simply run:

cd ~/.vim/bundle/YouCompleteMe
./install.py --all

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.

Full Installation Guide

These are the steps necessary to get YCM working on a Unix OS and on Windows.

Note to Windows users: we assume that you are running the cmd.exe command prompt and that the needed executables are in the PATH environment variable. Do 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.

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library APIs have changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

Please follow the instructions carefully. Read EVERY WORD.

  1. Ensure that your version of Vim is at least 7.4.1578 and that it has support for Python 2 or Python 3 scripting.

    Inside Vim, type :version. Look at the first two to three lines of output; it should say Vi IMproved X.Y, where X.Y is the major version of vim. If your version is greater than 7.4, then you're all set. If your version is 7.4 then look below that where it says, Included patches: 1-Z, where Z will be some number. That number needs to be 1578 or higher.

    If your version of Vim is not recent enough, you may need to [compile Vim from source][vim-build] (don't worry, it's easy).

    After you have made sure that you have Vim 7.4.1578+, type the following in Vim: :echo has('python') || has('python3'). The output should be 1. If it's 0, then get a 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 Python and the YCM libraries architectures. We recommend using a 64-bit Vim.

  2. Install YCM with [Vundle][] (or [Pathogen][], but Vundle is a better idea). With Vundle, this would mean adding a Plugin 'Valloric/YouCompleteMe' line to your [vimrc][].

    If you don't install YCM with Vundle, make sure you have run git submodule update --init --recursive after checking out the YCM repository (Vundle will do this for you) to fetch YCM's dependencies.

  3. [Complete this step ONLY if you care about semantic completion support for C-family languages. Otherwise it's not necessary.]

    Download the latest version of libclang. Clang is an open-source compiler that can compile C/C++/Objective-C/Objective-C++. The libclang library it provides is used to power the YCM semantic completion engine for those languages. YCM is designed to work with libclang version 3.9 or higher.

    You can use the system libclang only if you are sure it is version 3.9 or higher, otherwise don't. Even if it is, we recommend using the [official binaries from llvm.org][clang-download] if at all possible. Make sure you download the correct archive file for your OS.

    We STRONGLY recommend AGAINST use of the system libclang instead of the upstream compiled binaries. Random things may break. Save yourself the hassle and use the upstream pre-built libclang.

  4. Compile the ycm_core library that YCM needs. This library is the C++ engine that YCM uses to get fast completions.

    You will need to have cmake installed in order to generate the required makefiles. Linux users can install cmake with their package manager (sudo apt-get install cmake for Ubuntu) whereas other users can [download and install][cmake-download] cmake from its project site. Mac users can also get it through [Homebrew][brew] with brew install cmake.

    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 python3-dev. On Mac they should already be present.

    On Windows, you need to download and install [Python 2 or Python 3][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 12 (Visual Studio 2013), 14 (2015), and 15 (2017) are officially supported.

    Here we'll assume you installed YCM with Vundle. That means that the top-level YCM directory is in ~/.vim/bundle/YouCompleteMe.

    We'll create a new folder where build files will be placed. Run the following:

    cd ~
    mkdir ycm_build
    cd ycm_build

    Now we need to generate the makefiles. If you DON'T care about semantic support for C-family languages, run the following command in the ycm_build directory:

    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 12 Win64
    • Visual Studio 14 Win64
    • Visual Studio 15 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 -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.

    NOTE: We STRONGLY recommend AGAINST use of the system boost instead of the bundled version of boost. Random things may break. Save yourself the hassle and use the bundled version of boost.

    If you DO care about semantic support for C-family languages, then your 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 extracted the archive file to folder ~/ycm_temp/llvm_root_dir (with bin, 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 custom-built LLVM! See docs below for EXTERNAL_LIBCLANG_PATH when using a custom LLVM build.

    With that in mind, run the following command in the ycm_build directory:

    cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

    where <generator> is replaced like above.

    Now that configuration files have been generated, compile the libraries using this command:

    cmake --build . --target ycm_core --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 -DUSE_SYSTEM_LIBCLANG=ON to cmake instead of the -DPATH_TO_LLVM_ROOT=... flag.

    NOTE: We STRONGLY recommend AGAINST use of the system libclang instead of the upstream compiled binaries. Random things may break. Save yourself the hassle and use the upstream pre-built libclang.

    You could also force the use of a custom libclang library with -DEXTERNAL_LIBCLANG_PATH=/path/to/libclang.so flag (the library would end with .dylib on a Mac). Again, this flag would be used instead of the other flags. If you compiled LLVM from source, this is the flag you should be using.

    Running the cmake command will also place the libclang.[so|dylib|dll] in the YouCompleteMe/third_party/ycmd folder for you if you compiled with clang support (it needs to be there for YCM to work).

  5. Set up support for additional languages, as desired:

    • C# support: install [Mono on non-Windows platforms][mono-install]. Navigate to YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer and run

      msbuild /property:Configuration=Release /property:TargetFrameworkVersion=v4.5

      Replace msbuild by xbuild if msbuild is not available. On Windows, be sure that [the build utility msbuild is in your PATH][add-msbuild-to-path].

    • Go support: install [Go][go-install] and add it to your path. Navigate to YouCompleteMe/third_party/ycmd/third_party/gocode and run go build.

    • TypeScript support: as with the quick installation, simply npm install -g typescript after successfully installing [Node.js and npm][npm-install].

    • JavaScript support: install [Node.js and npm][npm-install]. Then navigate to YouCompleteMe/third_party/ycmd/third_party/tern_runtime and run npm install --production

    • Rust support: install [Rust][rust-install]. Navigate to YouCompleteMe/third_party/ycmd/third_party/racerd and run cargo build --release.

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.

Quick Feature Summary

General (all languages)

  • Super-fast identifier completer including tags files and syntax elements
  • Intelligent suggestion ranking and filtering
  • File and path suggestions
  • Suggestions from Vim's OmniFunc
  • UltiSnips snippet suggestions

C-family languages (C, C++, Objective C, Objective C++)

  • Semantic auto-completion
  • Real-time diagnostic display
  • Go to include/declaration/definition (GoTo, etc.)
  • Semantic type information for identifiers (GetType)
  • Automatically fix certain errors (FixIt)
  • View documentation comments for identifiers (GetDoc)

C♯

  • Semantic auto-completion
  • Real-time diagnostic display
  • Go to declaration/definition (GoTo, etc.)
  • Semantic type information for identifiers (GetType)
  • Automatically fix certain errors (FixIt)
  • Management of OmniSharp server instance
  • View documentation comments for identifiers (GetDoc)

Python

  • Intelligent auto-completion
  • Go to declaration/definition, find references (GoTo, GoToReferences)
  • View documentation comments for identifiers (GetDoc)
  • Restart [JediHTTP][] server using a different Python interpreter

Go

  • Semantic auto-completion
  • Go to definition (GoTo)
  • Management of gocode server instance

TypeScript

  • Semantic auto-completion
  • Real-time diagnostic display
  • Renaming symbols (RefactorRename <new name>)
  • Go to definition, find references (GoToDefinition, GoToReferences)
  • Semantic type information for identifiers (GetType)
  • View documentation comments for identifiers (GetDoc)

JavaScript

  • Intelligent auto-completion
  • Renaming variables (RefactorRename <new name>)
  • Go to definition, find references (GoToDefinition, GoToReferences)
  • Type information for identifiers (GetType)
  • View documentation comments for identifiers (GetDoc)
  • Management of Tern server instance

Rust

  • Semantic auto-completion
  • Go to definition (GoTo, GoToDefinition, and GoToDeclaration are identical)
  • Management of racer server instance
  • View documentation comments for identifiers (GetDoc)

User Guide

General Usage

  • If the offered completions are too broad, keep typing characters; YCM will continue refining the offered completions based on your input.
  • Filtering is "smart-case" sensitive; if you are typing only lowercase letters, then it's case-insensitive. If your input contains uppercase letters, then the uppercase letters in your query must match uppercase letters in the completion strings (the lowercase letters still match both). So, "foo" matches "Foo" and "foo", "Foo" matches "Foo" and "FOO" but not "foo".
  • Use the TAB key to accept a completion and continue pressing TAB to cycle through the completions. Use Shift-TAB to cycle backwards. Note that if you're using console Vim (that is, not Gvim or MacVim) then it's likely that the Shift-TAB binding will not work because the console will not pass it to Vim. You can remap the keys; see the [Options][] section below.

Knowing a little bit about how YCM works internally will prevent confusion. YCM has several completion engines: an identifier-based completer that collects all of the identifiers in the current file and other files you visit (and your tags files) and searches them when you type (identifiers are put into per-filetype groups).

There are also several semantic engines in YCM. There's a libclang-based completer that provides semantic completion for C-family languages. There's a Jedi-based completer for semantic completion for Python. There's also an omnifunc-based completer that uses data from Vim's omnicomplete system to provide semantic completions when no native completer exists for that language in YCM.

There are also other completion engines, like the UltiSnips completer and the filepath completer.

YCM automatically detects which completion engine would be the best in any situation. On occasion, it queries several of them at once, merges the outputs and presents the results to you.

Client-Server Architecture

YCM has a client-server architecture; the Vim part of YCM is only a thin client that talks to the [ycmd HTTP+JSON server][ycmd] that has the vast majority of YCM logic and functionality. The server is started and stopped automatically as you start and stop Vim.

Completion String Ranking

The subsequence filter removes any completions that do not match the input, but then the sorting system kicks in. It's actually very complicated and uses lots of factors, but suffice it to say that "word boundary" (WB) subsequence character matches are "worth" more than non-WB matches. In effect, this means given an input of "gua", the completion "getUserAccount" would be ranked higher in the list than the "Fooguxa" completion (both of which are subsequence matches). A word-boundary character are all capital characters, characters preceded by an underscore and the first letter character in the completion string.

General Semantic Completion

  • You can use Ctrl+Space to trigger the completion suggestions anywhere, even without a string prefix. This is useful to see which top-level functions are available for use.

C-family Semantic Completion

In order to perform semantic analysis such as code completion, GoTo and diagnostics, YouCompleteMe uses libclang. This is the library version of the clang compiler, sometimes also referred to as llvm. Like any compiler, libclang requires a set of compile flags in order to parse your code. Simply put: If libclang can't parse your code, YouCompleteMe can't provide semantic analysis.

There are 2 methods which can be used to provide compile flags to libclang:

Option 1: Use a [compilation database][compdb]

The easiest way to get YCM to compile your code is to use a compilation database. A compilation database is usually generated by your build system (e.g. CMake) and contains the compiler invocation for each compilation unit in your project.

For information on how to generate a compilation database, see the [clang documentation][compdb]. In short:

  • If using CMake, add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON when configuring (or add set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) to CMakeLists.txt) and copy or symlink the generated database to the root of your project.
  • If using Ninja, check out the compdb tool (-t compdb) in its [docs][ninja-compdb].
  • If using GNU make, check out [Bear][].
  • For other build systems, check out .ycm_extra_conf.py below.

If no .ycm_extra_conf.py is found, and no ycm_global_ycm_extra_conf is configured, YouCompleteMe automatically tries to load a compilation database if one is found.

YCM looks for a file named compile_commands.json in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded. YouCompleteMe performs the following lookups when extracting flags for a particular file:

  • If the database contains an entry for the file, the flags for that file are used.
  • If the file is a header file and a source file with the same root exists in the database, the flags for the source file are used. For example, if the file is /home/Test/project/src/lib/something.h and the database contains an entry for /home/Test/project/src/lib/something.cc, then the flags for /home/Test/project/src/lib/something.cc are used.
  • Otherwise, if any flags have been returned from the directory containing the requested file, those flags are used. This heuristic is intended to provide potentially working flags for newly created files.

Finally, YCM converts any relative paths in the extracted flags to absolute paths. This ensures that compilation can be performed from any Vim working directory.

Option 2: Provide the flags manually

If you don't have a compilation database, or aren't able to generate one, you have to tell YouCompleteMe how to compile your code some other way.

Every c-family project is different. It is not possible for YCM to guess what compiler flags to supply for your project. Fortunately, YCM provides a mechanism for you to generate the flags for a particular file with arbitrary complexity. This is achieved by requiring you to provide a Python module which implements a trival function which, given the file name as argument, returns a list of compiler flags to use to compile that file.

YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a FlagsForFile method in that module which should provide it with the information necessary to compile the current file. You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback. To prevent the execution of malicious code from a file you didn't write YCM will ask you once per .ycm_extra_conf.py if it is safe to load. This can be disabled and you can white-/blacklist files. See the Options section for more details.

This system was designed this way so that the user can perform any arbitrary sequence of operations to produce a list of compilation flags YCM should hand to Clang.

NOTE: It is highly recommended to include -x <language> flag to libclang. This is so that the correct language is detected, particularly for header files. Common values are -x c for C, -x c++ for C++ and -x objc for Objective-C.

To give you an impression, if your c++ project is trivial, and your usual compilation command is: g++ -Wall -Wextra -Werror -o FILE.o FILE.cc, then the following .ycm_extra_conf.py is enough to get semantic analysis from YouCompleteMe:

def FlagsForFile( filename, **kwargs ):
  return {
    'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-Werror' ],
  }

As you can see from the trivial example, YCM calls the FlagsForFile method, passing it the file name. The **kwargs is for advanced users and can usually be ignored. The FlagsForFile function returns a dictionary with a single element 'flags'. This element is a list of compiler flags to pass to libclang for the file filename. That's it! This is actually enough for most projects, but for complex projects it is not uncommon to integrate directly with an existing build system using the full power of the Python language.

For a more elaborate example, [see YCM's own .ycm_extra_conf.py][flags_example]. You should be able to use it as a starting point. Don't just copy/paste that file somewhere and expect things to magically work; your project needs different flags. Hint: just replace the strings in the flags variable with compilation flags necessary for your project. That should be enough for 99% of projects.

You could also consider using [YCM-Generator][ygen] to generate the ycm_extra_conf.py file.

Errors during compilaton

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 the completion menu finally appears, it's going to have a large number of unrelated completion strings (type/function names that are not actually members). This is because Clang fails to build a precompiled preamble for your file if there are any errors in the included headers and that preamble is key to getting fast completions.

Call the :YcmDiags command to see if any errors or warnings were detected in your file.

JavaScript Semantic Completion

Quick start

  1. Ensure that you have enabled the Tern completer. See the installation guide for details.

  2. Create a .tern-project file in the root directory of your JavaScript project, by following the [instructions][tern-project] in the [Tern][] documentation.

  3. Make sure that Vim's working directory is a descendent of that directory (or that directory itself) when working with JavaScript files.

Explanation

JavaScript completion is based on [Tern][]. This completion engine requires a file named [.tern-project][tern-project] to exist in the current working directory or a directory which is an ancestor of the current working directory when the tern server is started. YCM starts the Tern server the first time a JavaScript file is edited, so Vim's working directory at that time needs to be a descendent of the directory containing the .tern-project file (or that directory itself).

Alternatively, as described in the [Tern documentation][tern-docs], a global .tern-config file may be used.

Multiple Tern servers, are not supported. To switch to a different JavaScript project, you can do one of the following:

  • start a new instance of Vim from the new project's directory
  • change Vim's working directory (:cd /path/to/new/project) and restart the [ycmd server][ycmd] (:YcmRestartServer)
  • change Vim's working directory (:cd /path/to/new/project), open a JavaScript file (or set filetype to JavaScript) and restart the Tern server using YCM completer subcommand :YcmCompleter RestartServer.

Tips and tricks

This section contains some advice for configuring .tern-project and working with JavaScript files. The canonical reference for correctly configuring Tern is the [Tern documentation][tern-docs]. Any issues, improvements, advice, etc. should be sought from the [Tern][] project. For example, see the list of tern plugins for the list of plugins which can be enabled in the plugins section of the .tern-project file.

Configuring Tern for node support

The following simple example .tern-project file enables nodejs support:

{
    "plugins": {
        "node": {}
    }
}
Configuring Tern for requirejs support

The Tern requirejs plugin requires that all included "libraries" are rooted under the same base directory. If that's not the case for your projects, then it is possible to make it work with appropriate symbolic links. For example, create a directory ext_lib within your project and populate it with symlinks to your libraries. Then set up the .tern-project something like this:


{
  "plugins": {
    "requirejs": {
      "baseURL": "./ext_lib",
    }
  }
}

Then, given the following structure:

./ext_lib/mylib (symlink)
./ext_lib/anotherlib (symlink)

Can be used as follows:

define( [ 'mylib/file1', 'anotherlib/anotherfile' ], function( f1, f2 ) {
    // etc.
} );

Rust Semantic Completion

Completions and GoTo commands within the current crate and its dependencies should work out of the box with no additional configuration (provided that you built YCM with the --racer-completer flag; see the Installation section for details). For semantic analysis inclusive of the standard library, you must have a local copy of [the rust source code][rust-src]. You also need to set the following option so YouCompleteMe can locate it.

" In this example, the rust source code zip has been extracted to
" /usr/local/rust/rustc-1.5.0
let g:ycm_rust_src_path = '/usr/local/rust/rustc-1.5.0/src'

Python Semantic Completion

Completion and GoTo commands work out of the box with no additional configuration. Those features are provided by the [jedi][] library which supports a variety of Python versions (2.6, 2.7, 3.2+) as long as it runs in the corresponding Python interpreter. By default YCM runs [jedi][] with the same Python interpreter used by the [ycmd server][ycmd], so if you would like to use a different interpreter, use the following option specifying the Python binary to use. For example, to provide Python 3 completion in your project, set:

let g:ycm_python_binary_path = '/usr/bin/python3'

If the value of g:ycm_python_binary_path is an absolute path like above it will be used as-is, but if it's an executable name it will be searched through the PATH. So for example if you set:

let g:ycm_python_binary_path = 'python'

YCM will use the first python executable it finds in the PATH to run [jedi][]. This means that if you are in a virtual environment and you start vim in that directory, the first python that YCM will find will be the one in the virtual environment, so [jedi][] will be able to provide completions for every package you have in the virtual environment.

Semantic Completion for Other Languages

C-family, C#, Go, JavaScript, Python, Rust, and TypeScript languages are supported natively by YouCompleteMe using the [Clang][], [OmniSharp][], [Gocode][]/[Godef][], [Tern][], [Jedi][], [racer][], and [TSServer][] 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 semantic completions if it does not have a native semantic completion engine for your file's filetype. Vim comes with okayish omnifuncs for various languages like Ruby, PHP, etc. It depends on the language.

You can get stellar omnifuncs for Java and Ruby with [Eclim][]. Just make sure you have the latest Eclim installed and configured (this means Eclim >= 2.2.* and Eclipse >= 4.2.*).

After installing Eclim remember to create a new Eclipse project within your application by typing :ProjectCreate <path-to-your-project> -n ruby (or -n java) inside vim and don't forget to have let g:EclimCompletionMethod = 'omnifunc' in your vimrc. This will make YCM and Eclim play nice; YCM will use Eclim's omnifuncs as the data source for semantic completions and provide the auto-triggering and subsequence-based matching (and other YCM features) on top of it.

Writing New Semantic Completers

You have two options here: writing an omnifunc for Vim's omnicomplete system that YCM will then use through its omni-completer, or a custom completer for YCM using the [Completer API][completer-api].

Here are the differences between the two approaches:

  • You have to use VimScript to write the omnifunc, but get to use Python to write for the Completer API; this by itself should make you want to use the API.
  • The Completer API is a much more powerful way to integrate with YCM and it provides a wider set of features. For instance, you can make your Completer query your semantic back-end in an asynchronous fashion, thus not blocking Vim's GUI thread while your completion system is processing stuff. This is impossible with VimScript. All of YCM's completers use the Completer API.
  • Performance with the Completer API is better since Python executes faster than VimScript.

If you want to use the omnifunc system, see the relevant Vim docs with :h complete-functions. For the Completer API, see [the API docs][completer-api].

If you want to upstream your completer into YCM's source, you should use the Completer API.

Diagnostic Display

YCM will display diagnostic notifications for C-family and C# languages if you compiled YCM with Clang and Omnisharp support, respectively. Diagnostics will also be displayed for TypeScript. Since YCM continuously recompiles your file as you type, you'll get notified of errors and warnings in your file as fast as possible.

Here are the various pieces of the diagnostic UI:

  • Icons show up in the Vim gutter on lines that have a diagnostic.
  • Regions of text related to diagnostics are highlighted (by default, a red wavy underline in gvim and a red background in vim).
  • Moving the cursor to a line with a diagnostic echoes the diagnostic text.
  • Vim's location list is automatically populated with diagnostic data (off by default, see options).

The new diagnostics (if any) will be displayed the next time you press any key on the keyboard. So if you stop typing and just wait for the new diagnostics to come in, that will not work. You need to press some key for the GUI to update.

Having to press a key to get the updates is unfortunate, but cannot be changed due to the way Vim internals operate; there is no way that a background task can update Vim's GUI after it has finished running. You have to press a key. This will make YCM check for any pending diagnostics updates.

You can force a full, blocking compilation cycle with the :YcmForceCompileAndDiagnostics command (you may want to map that command to a key; try putting nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> in your vimrc). Calling this command will force YCM to immediately recompile your file and display any new diagnostics it encounters. Do note that recompilation with this command may take a while and during this time the Vim GUI will be blocked.

YCM will display a short diagnostic message when you move your cursor to the line with the error. You can get a detailed diagnostic message with the <leader>d key mapping (can be changed in the options) YCM provides when your cursor is on the line with the diagnostic.

You can also see the full diagnostic message for all the diagnostics in the current file in Vim's locationlist, which can be opened with the :lopen and :lclose commands (make sure you have set let g:ycm_always_populate_location_list = 1 in your vimrc). A good way to toggle the display of the locationlist with a single key mapping is provided by another (very small) Vim plugin called [ListToggle][] (which also makes it possible to change the height of the locationlist window), also written by yours truly.

Diagnostic Highlighting Groups

You can change the styling for the highlighting groups YCM uses. For the signs in the Vim gutter, the relevant groups are:

  • YcmErrorSign, which falls back to group SyntasticErrorSign and then error if they exist
  • YcmWarningSign, which falls back to group SyntasticWarningSign and then todo if they exist

You can also style the line that has the warning/error with these groups:

  • YcmErrorLine, which falls back to group SyntasticErrorLine if it exists
  • YcmWarningLine, which falls back to group SyntasticWarningLine if it exists

Note that the line highlighting groups only work when gutter signs are turned on.

The syntax groups used to highlight regions of text with errors/warnings:

  • YcmErrorSection, which falls back to group SyntasticError if it exists and then SpellBad
  • YcmWarningSection, which falls back to group SyntasticWarning if it exists and then SpellCap

Here's how you'd change the style for a group:

highlight YcmErrorLine guibg=#3f0000

Commands

The :YcmRestartServer command

If the [ycmd completion server][ycmd] suddenly stops for some reason, you can restart it with this command.

The :YcmForceCompileAndDiagnostics command

Calling this command will force YCM to immediately recompile your file and display any new diagnostics it encounters. Do note that recompilation with this command may take a while and during this time the Vim GUI will be blocked.

You may want to map this command to a key; try putting nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> in your vimrc.

The :YcmDiags command

Calling this command will fill Vim's locationlist with errors or warnings if any were detected in your file and then open it. If a given error or warning can be fixed by a call to :YcmCompleter FixIt, then (FixIt available) is appended to the error or warning text. See the FixIt completer subcommand for more information.

NOTE: The absense of (FixIt available) does not strictly imply a fix-it is not available as not all completers are able to provide this indication. For example, the c-sharp completer provides many fix-its but does not add this additional indication.

The g:ycm_open_loclist_on_ycm_diags option can be used to prevent the location list from opening, but still have it filled with new diagnostic data. See the Options section for details.

The :YcmShowDetailedDiagnostic command

This command shows the full diagnostic text when the user's cursor is on the line with the diagnostic.

The :YcmDebugInfo command

This will print out various debug information for the current file. Useful to see what compile commands will be used for the file if you're using the semantic completion engine.

The :YcmToggleLogs command

This command opens in separate windows the logfiles given as arguments or closes them if they are already open in the editor. When no argument is given, list the available logfiles. Only for debugging purpose.

The :YcmCompleter command

This command gives access to a number of additional IDE-like features in YCM, for things like semantic GoTo, type information, FixIt and refactoring.

Technically the command invokes completer-specific commands. If the first argument is of the form ft=... the completer for that file type will be used (for example ft=cpp), else the native completer of the current buffer will be used. Call YcmCompleter without further arguments for a list of the commands you can call for the current completer.

See the file type feature summary for an overview of the features available for each file type. See the YcmCompleter subcommands section for more information on the available subcommands and their usage.

YcmCompleter Subcommands

NOTE: See the docs for the YcmCompleter command before tackling this section.

The invoked subcommand is automatically routed to the currently active semantic completer, so :YcmCompleter GoToDefinition will invoke the GoToDefinition subcommand on the Python semantic completer if the currently active file is a Python one and on the Clang completer if the currently active file is a C/C++/Objective-C one.

You may also want to map the subcommands to something less verbose; for instance, nnoremap <leader>jd :YcmCompleter GoTo<CR> maps the <leader>jd sequence to the longer subcommand invocation.

GoTo Commands

These commands are useful for jumping around and exploring code. When moving the cursor, the subcommands add entries to Vim's jumplist so you can use CTRL-O to jump back to where you where before invoking the command (and CTRL-I to jump forward; see :h jumplist for details). If there is more than one destination, the quickfix list (see :h quickfix) is populated with the available locations and opened to full width at the bottom of the screen. You can change this behavior by using the YcmQuickFixOpened autocommand.

The GoToInclude subcommand

Looks up the current line for a header and jumps to it.

Supported in filetypes: c, cpp, objc, objcpp

The GoToDeclaration subcommand

Looks up the symbol under the cursor and jumps to its declaration.

Supported in filetypes: c, cpp, objc, objcpp, cs, go, python, rust

The GoToDefinition subcommand

Looks up the symbol under the cursor and jumps to its definition.

NOTE: For C-family languages this only works in certain situations, namely when the definition of the symbol is in the current translation unit. A translation unit consists of the file you are editing and all the files you are including with #include directives (directly or indirectly) in that file.

Supported in filetypes: c, cpp, objc, objcpp, cs, go, javascript, python, rust, typescript

The GoTo subcommand

This command tries to perform the "most sensible" GoTo operation it can. Currently, this means that it tries to look up the symbol under the cursor and jumps to its definition if possible; if the definition is not accessible from the current translation unit, jumps to the symbol's declaration. For C/C++/Objective-C, it first tries to look up the current line for a header and jump to it. For C#, implementations are also considered and preferred.

Supported in filetypes: c, cpp, objc, objcpp, cs, go, javascript, python, rust

The GoToImprecise subcommand

WARNING: This command trades correctness for speed!

Same as the GoTo command except that it doesn't recompile the file with libclang before looking up nodes in the AST. This can be very useful when you're editing files that take long to compile but you know that you haven't made any changes since the last parse that would lead to incorrect jumps. When you're just browsing around your codebase, this command can spare you quite a bit of latency.

Supported in filetypes: c, cpp, objc, objcpp

The GoToReferences subcommand

This command attempts to find all of the references within the project to the identifier under the cursor and populates the quickfix list with those locations.

Supported in filetypes: javascript, python, typescript

The GoToImplementation subcommand

Looks up the symbol under the cursor and jumps to its implementation (i.e. non-interface). If there are multiple implementations, instead provides a list of implementations to choose from.

Supported in filetypes: cs

The GoToImplementationElseDeclaration subcommand

Looks up the symbol under the cursor and jumps to its implementation if one, else jump to its declaration. If there are multiple implementations, instead provides a list of implementations to choose from.

Supported in filetypes: cs

Semantic Information Commands

These commands are useful for finding static information about the code, such as the types of variables, viewing declarations and documentation strings.

The GetType subcommand

Echos the type of the variable or method under the cursor, and where it differs, the derived type.

For example:

    std::string s;

Invoking this command on s returns std::string => std::basic_string<char>

NOTE: Due to limitations of libclang, invoking this command on the word auto typically returns auto. However, invoking it on a usage of the variable with inferred type returns the correct type, but typically it is repeated due to libclang returning that the types differ.

For example:

const char *s = "String";
auto x = &s; // invoking on x or auto returns "auto";
             // invoking on s returns "const char *"
std::cout << *x; // invoking on x returns "const char ** => const char **"

NOTE: Causes re-parsing of the current translation unit.

Supported in filetypes: c, cpp, objc, objcpp, javascript, typescript

The GetTypeImprecise subcommand

WARNING: This command trades correctness for speed!

Same as the GetType command except that it doesn't recompile the file with libclang before looking up nodes in the AST. This can be very useful when you're editing files that take long to compile but you know that you haven't made any changes since the last parse that would lead to incorrect type. When you're just browsing around your codebase, this command can spare you quite a bit of latency.

Supported in filetypes: c, cpp, objc, objcpp

The GetParent subcommand

Echos the semantic parent of the point under the cursor.

The semantic parent is the item that semantically contains the given position.

For example:

class C {
    void f();
};

void C::f() {

}

In the out-of-line definition of C::f, the semantic parent is the class C, of which this function is a member.

In the example above, both declarations of C::f have C as their semantic context, while the lexical context of the first C::f is C and the lexical context of the second C::f is the translation unit.

For global declarations, the semantic parent is the translation unit.

NOTE: Causes re-parsing of the current translation unit.

Supported in filetypes: c, cpp, objc, objcpp

The GetDoc subcommand

Displays the preview window populated with quick info about the identifier under the cursor. Depending on the file type, this includes things like:

  • The type or declaration of identifier,
  • Doxygen/javadoc comments,
  • Python docstrings,
  • etc.

Supported in filetypes: c, cpp, objc, objcpp, cs, python, typescript, javascript, rust

The GetDocImprecise subcommand

WARNING: This command trades correctness for speed!

Same as the GetDoc command except that it doesn't recompile the file with libclang before looking up nodes in the AST. This can be very useful when you're editing files that take long to compile but you know that you haven't made any changes since the last parse that would lead to incorrect docs. When you're just browsing around your codebase, this command can spare you quite a bit of latency.

Supported in filetypes: c, cpp, objc, objcpp

Refactoring and FixIt Commands

These commands make changes to your source code in order to perform refactoring or code correction. YouCompleteMe does not perform any action which cannot be undone, and never saves or writes files to the disk.

The FixIt subcommand

Where available, attempts to make changes to the buffer to correct diagnostics on the current line. Where multiple suggestions are available (such as when there are multiple ways to resolve a given warning, or where multiple diagnostics are reported for the current line), the options are presented and one can be selected.

Completers which provide diagnostics may also provide trivial modifications to the source in order to correct the diagnostic. Examples include syntax errors such as missing trailing semi-colons, spurious characters, or other errors which the semantic engine can deterministically suggest corrections.

If no fix-it is available for the current line, or there is no diagnostic on the current line, this command has no effect on the current buffer. If any modifications are made, the number of changes made to the buffer is echo'd and the user may use the editor's undo command to revert.

When a diagnostic is available, and g:ycm_echo_current_diagnostic is set to 1, then the text (FixIt) is appended to the echo'd diagnostic when the completer is able to add t

Related Repositories

spf13-vim

spf13-vim

The ultimate vim distribution ...

YCM-Generator

YCM-Generator

Generates config files for YouCompleteMe (https://github.com/Valloric/YouComplet ...

vimplus

vimplus

:rocket:An automatic configuration program for vim ...

atom-youcompleteme

atom-youcompleteme

YouCompleteMe for Atom Editor ...

vim.cpp

vim.cpp

:four_leaf_clover: Building vim editor in Linux into an effective C/C++ program ...


Top Contributors

Valloric homu micbou puremourning Chiel92 mispencer vheon JazzCore rizzatti davits nop00 ekfriis kljohann kennykaye xgalaxy svermeulen jwilm nickhutchinson olajep aslater LeszekSwirski kristijanhusak icholy adelarsq grncdr tlvince vitalyster svanburen peter50216 cehoffman