SkillAgentSearch skills...

YouCompleteMe

A code-completion engine for Vim

Install / Use

/learn @ycm-core/YouCompleteMe
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

YouCompleteMe: a code-completion engine for Vim

Gitter room Build status Coverage status

Help, Advice, Support

Looking for help, advice, or support? Having problems getting YCM to work?

First carefully read the installation instructions for your OS. We recommend you use the supplied install.py - the "full" installation guide is for rare, advanced use cases and most users should use install.py.

If the server isn't starting and you're getting a "YouCompleteMe unavailable" error, check the [Troubleshooting][wiki-troubleshooting] guide.

Next, check the User Guide section on the semantic completer that you are using. For C/C++/Objective-C/Objective-C++/CUDA, you must read this section.

Finally, check the [FAQ][wiki-faq].

If, after reading the installation and user guides, and checking the FAQ, you're still having trouble, check the contacts section below for how to get in touch.

Please do NOT go to #vim on Freenode for support. Please contact the YouCompleteMe maintainers directly using the contact details below.

Vundle

Please note that the below instructions suggest using Vundle. Currently there are problems with Vundle, so here are some alternative instructions using Vim packages.

Contents

Intro

YouCompleteMe is a fast, as-you-type, fuzzy-search code completion, comprehension and refactoring engine for [Vim][].

It has several completion engines built-in and supports any protocol-compliant Language Server, so can work with practically any language. YouCompleteMe contains:

  • an identifier-based engine that works with every programming language,
  • a powerful [clangd][]-based engine that provides native semantic code completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred to as "the C-family languages"),
  • a [Jedi][]-based completion engine for Python 2 and 3,
  • an [OmniSharp-Roslyn][]-based completion engine for C#,
  • a [Gopls][]-based completion engine for Go,
  • a [TSServer][]-based completion engine for JavaScript and TypeScript,
  • a [rust-analyzer][]-based completion engine for Rust,
  • a [jdt.ls][]-based completion engine for Java.
  • a generic Language Server Protocol implementation for any language
  • 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 completion demo

Here's an explanation of what happened in the last 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 the completer engine 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.

And that's not all...

YCM might be the only Vim completion engine with the correct Unicode support. Though we do assume UTF-8 everywhere.

YouCompleteMe GIF unicode demo

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

For example, here's a demo of signature help:

Signature Help Early Demo

Below we can see YCM being able to do a few things:

  • Retrieve references across files
  • Go to declaration/definition
  • Expand auto in C++
  • Fix some common errors, and provide refactorings, with FixIt
  • Not shown in the GIF are GoToImplementation and GoToType for servers that support it.

YouCompleteMe GIF subcommands demo

And here's some documentation being shown in a hover popup, automatically and manually:

hover demo

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

Requirements

| Runtime | Min Version | Recommended Version (full support) | Python | |----

View on GitHub
GitHub Stars26.3k
CategoryDevelopment
Updated3h ago
Forks2.8k

Languages

Python

Security Score

100/100

Audited on Mar 29, 2026

No findings