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 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.

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.

Contents
Intro
Installation
Requirements
macOS
Linux 64-bit
Windows
FreeBSD/OpenBSD
Full Installation Guide
Quick Feature Summary
User Guide
General Usage
Client-Server Architecture
Completion String Ranking
General Semantic Completion
C-family Semantic Completion
Java Semantic Completion
C# Semantic Completion
Python Semantic Completion
Rust Semantic Completion
Go Semantic Completion
JavaScript and TypeScript Semantic Completion
Semantic Completion for Other Languages
LSP Configuration
Writing New Semantic Completers
Diagnostic Display
Diagnostic Highlighting Groups
Commands
YcmCompleter subcommands
GoTo Commands
Semantic Information Commands
Refactoring Commands
Miscellaneous Commands
Functions
Autocommands
Options
FAQ
Contributor Code of Conduct
Contact
License
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 happens 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:

displaying signature help (argument hints) when entering the arguments to a function call (Vim only)
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, or in a popup next to the cursor (Vim only)
fixing common coding errors, like missing semi-colons, typos, etc.,
semantic renaming of variables across files,
formatting code,
removing unused imports, sorting imports, etc.
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 with FixIt
Not shown in the gif is 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
Minimum supported versions:

Vim v8.1.2269 huge build, compiled with Python 3.6 support (aka vim-nox in Ubuntu 20.04 LTS)
Python 3.6 runtime, compiled with --enable-shared (or --enable-framework)
Please note that some features are not availble in Neovim, and Neovim is not officially supported.

macOS
Quick start, installing all completers
Install YCM plugin via Vundle
Install cmake, macvim and python; Note that the system vim is not supported.
brew install cmake macvim python mono go nodejs
Compile YCM
cd ~/.vim/bundle/YouCompleteMe
python3 install.py --all
For plugging an arbitrary LSP server, check the relevant section
Explanation for the quick start
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.

MacVim is required. YCM won’t work with the pre-installed Vim from Apple as its Python support is broken. If you don’t already use MacVim, install it with Homebrew. Install CMake as well:

brew install cmake macvim
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)

Compiling YCM with semantic support for C-family languages through clangd:

cd ~/.vim/bundle/YouCompleteMe
./install.py --clangd-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 or by downloading the Mono macOS package and add --cs-completer when calling install.py.
Go support: install Go and add --go-completer when calling install.py.
JavaScript and TypeScript support: install Node.js and npm and add --ts-completer when calling install.py.
Rust support: add --rust-completer when calling install.py.
Java support: install JDK8 (version 8 required) and add --java-completer when calling install.py.
To simply compile with everything enabled, there’s a --all flag. You need to specify it manually by adding --clangd-completer. So, to install with all language features, ensure xbuild, go, node and npm 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.

Linux 64-bit
Quick start, installing all completers
Install YCM plugin via Vundle
Install cmake, vim and python
apt install build-essential cmake vim python3-dev
Install mono-complete, go, node and npm
Compile YCM

ycm-core/YouCompleteMe相关推荐

  1. YouCompleteMe(YCM)安装时遇到的问题(能遇到的几乎都遇到了)

    YouCompleteMe(YCM)安装时遇到的问题 准备阶段(安装依赖) python动态库问题 编译期间的问题(卡在了Found Python3:XXX Interpreter Developme ...

  2. 手把手教你配置linux下C++开发工具——vim+ycm(YouCompleteMe),支持基于语义的自动补全和第三方库补全(史上最简单、史上最透彻、史上最全的终极解决方案)

    截止到目前,vim稳定版本已经到了8.2+,ycm(YouCompleteMe的简称)最新版本与几年前的安装配置截然不同了.之前网上很多教程也教不得法,生搬硬套,没有讲透彻.所以,才下定决心写一篇自认 ...

  3. 给VIM安装YouCompleteMe插件

    VIM已有Vundle插件管理,以为安装比较简单,使用vundle安装的. 文件下载完毕提示没有YCM CORE.上网搜索下需要在插件目录编译,去YouCompleteMe的github可以看到有安装 ...

  4. 在CentOS 6.6 64bit上安装vim智能补全插件YouCompleteMe

    简介 YouCompleteMe是一个随键而动的.支持模糊搜索的.高速补全的插件.YCM由google公司搜索项目组的软件工程师Strahinja Val Markovic所开发,YCM后端调用lib ...

  5. Vim自动补全神器:YouCompleteMe

    From:http://www.jianshu.com/p/d908ce81017a github 地址:https://github.com/Valloric/YouCompleteMe YouCo ...

  6. windows10下安装、配置vim及YCM安装

    久仰vim编辑器之神的大名,最近出于好奇,在windows10下折腾了一下,在此记录一下历程. 文章目录 1. windows10下的vim安装和配置 1.1 安装vim 1.2. 基础设置 1.3. ...

  7. 安装Vundle和YouCompleteMe

    一.Vundle 这是一个vim的插件管理器,可以增强vim的功能. 1.安装 默认的是安装在/.vim/bundle/vundle下 $ git clone https://github.com/V ...

  8. 神级编辑器 Vim 使用-插件篇

    在这篇中, 会列举各种实用的插件, 包括他们的安装, 配置及使用方法 注意: 不是本部分的所有插件都是你需要装的, 如果盲目安装插件只会导致你 vim 功能混乱, 速度底下, 所以适时整理真正需要的插 ...

  9. Ubuntu20.04安装与配置记录

    Ubuntu20.04安装与配置记录 原文地址:Ubuntu20.04安装与配置记录 一.Ubuntu系统盘制作 1.1 Windows环境下制作系统盘 下载Ubuntu系统,选择桌面版. 下载工具系 ...

  10. 安装vimplus后提示 The ycmd server SHUT DOWN的解决方法

    错误log: The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library not detected 解 ...

最新文章

  1. OpenCV+python:直方图的应用(一)
  2. 微信电脑客户端登陆_电脑端微信多开教程,多个微信同时登陆,工作生活两不误...
  3. POJ 2449 Remmarguts' Date(k短路模板)
  4. 重构——71将领域和表述/显示分开(Separate Domain from Presentation)
  5. 高服从编纂器 VIM-操作篇(1)
  6. 【转】Microsoft Teams快速上手系列-02Teams组成概述及使用分享
  7. 首秀双折叠屏手机却被友商炮轰 小米回应:悍然碰瓷!
  8. MySQL查询语句(select)详解
  9. Dictionary集合
  10. 印度:10美元电脑与全民免费上网
  11. matlab之find函数
  12. 将 cordova-simulate 依赖项安装到扩展时出错(解决方案)
  13. CR渲染器全景图如何渲染颜色通道_3d Max设计师们的“偷懒”小技巧——云渲染篇...
  14. 学习随笔——2.仿苹果官网效果,滚动缩放图片
  15. Unity 5.3 官方VR教程(—)VR综述
  16. 代写php代码作业,C++代写 CS 100 Project Two代做php实验作业
  17. 伪类选择器编写顺序以及注意事项
  18. 字节跳动年薪百万的测试开发=“半个产品+半个开发”?
  19. python中forward的参数_ip_forward参数对Linux内核转发影响分析
  20. K_A07_003 基于 STM32等单片机驱动DRV8825模块按键控制步进电机正反转

热门文章

  1. 基于八叉树的网格生成算法剖析
  2. 计算机网络通信主要特点,数字通信网络的主要特征是什么
  3. CCV1.5 屏幕校正点删减调节
  4. 外向的人为何却喜欢孤独
  5. WCDMA的高速引擎 细解HSDPA技术(转)
  6. XP设置屏保密码,但不设置开机密码问题
  7. W32DASM 和 OLLYDBG 配合起来破解反汇编算法
  8. opencl.dll丢失怎么办?为什么会丢失?
  9. Wscript的popup
  10. 基于二分查找的抽签游戏算法的优化