{"id":13393903,"url":"https://github.com/ycm-core/YouCompleteMe","last_synced_at":"2025-03-13T19:31:51.847Z","repository":{"id":3017792,"uuid":"4037197","full_name":"ycm-core/YouCompleteMe","owner":"ycm-core","description":"A code-completion engine for Vim","archived":false,"fork":false,"pushed_at":"2024-10-13T21:53:03.000Z","size":36954,"stargazers_count":25450,"open_issues_count":26,"forks_count":2806,"subscribers_count":559,"default_branch":"master","last_synced_at":"2024-10-30T06:57:38.624Z","etag":null,"topics":["code-analysis","code-completion","semantic-engine","vim"],"latest_commit_sha":null,"homepage":"http://ycm-core.github.io/YouCompleteMe/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ycm-core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-16T03:12:14.000Z","updated_at":"2024-10-30T04:00:12.000Z","dependencies_parsed_at":"2023-07-10T02:21:32.118Z","dependency_job_id":"91e689fb-eea1-4fb3-9dbd-b58019466f08","html_url":"https://github.com/ycm-core/YouCompleteMe","commit_stats":{"total_commits":2429,"total_committers":197,"mean_commits":12.32994923857868,"dds":0.5516673528200906,"last_synced_commit":"63ab13e95141c252c545f9a6c7144ced6790d68f"},"previous_names":["valloric/youcompleteme"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ycm-core","download_url":"https://codeload.github.com/ycm-core/YouCompleteMe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242956533,"owners_count":20212456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-analysis","code-completion","semantic-engine","vim"],"created_at":"2024-07-30T17:01:02.234Z","updated_at":"2025-03-13T19:31:51.823Z","avatar_url":"https://github.com/ycm-core.png","language":"Python","readme":"YouCompleteMe: a code-completion engine for Vim\n===============================================\n\n[![Gitter room](https://img.shields.io/gitter/room/Valloric/YouCompleteMe.svg)](https://gitter.im/Valloric/YouCompleteMe)\n[![Build status](https://dev.azure.com/YouCompleteMe/YCM/_apis/build/status/ycm-core.YouCompleteMe?branchName=master)](https://dev.azure.com/YouCompleteMe/YCM/_build?definitionId=3\u0026branchName=master)\n[![Coverage status](https://img.shields.io/codecov/c/github/ycm-core/YouCompleteMe/master.svg)](https://codecov.io/gh/ycm-core/YouCompleteMe)\n\nHelp, Advice, Support\n---------------------\n\nLooking for help, advice, or support? Having problems getting YCM to work?\n\nFirst carefully read the [installation instructions](#installation) for your OS.\nWe recommend you use the supplied `install.py` - the \"full\" installation guide\nis for rare, advanced use cases and most users should use `install.py`.\n\nIf the server isn't starting and you're getting a \"YouCompleteMe unavailable\"\nerror, check the [Troubleshooting][wiki-troubleshooting] guide.\n\nNext, check the [User Guide](#user-guide) section on the semantic completer that\nyou are using. For C/C++/Objective-C/Objective-C++/CUDA, you  _must_ read [this\nsection](#c-family-semantic-completion).\n\nFinally, check the [FAQ][wiki-faq].\n\nIf, after reading the installation and user guides, and checking the FAQ, you're\nstill having trouble, check the [contacts](#contact) section below for how to\nget in touch.\n\nPlease do **NOT** go to #vim on Freenode for support. Please contact the\nYouCompleteMe maintainers directly using the [contact details](#contact) below.\n\n# Vundle\n\nPlease note that the below instructions suggest using Vundle. Currently there\nare problems with Vundle, so here are some [alternative instructions](https://github.com/ycm-core/YouCompleteMe/issues/4134#issuecomment-1446235584) using Vim packages.\n\nContents\n--------\n\n- [Intro](#intro)\n- [Installation](#installation)\n    - [Requirements](#requirements)\n    - [macOS](#macos)\n    - [Linux 64-bit](#linux-64-bit)\n    - [Windows](#windows)\n    - [Full Installation Guide](#full-installation-guide)\n- [Quick Feature Summary](#quick-feature-summary)\n- [User Guide](#user-guide)\n    - [General Usage](#general-usage)\n    - [Client-Server Architecture](#client-server-architecture)\n    - [Completion String Ranking](#completion-string-ranking)\n    - [General Semantic Completion](#general-semantic-completion)\n    - [Signature Help](#signature-help)\n    - [Semantic Highlighting](#semantic-highlighting)\n    - [Inlay Hints](#inlay-hints)\n    - [C-family Semantic Completion](#c-family-semantic-completion)\n    - [Java Semantic Completion](#java-semantic-completion)\n    - [C# Semantic Completion](#c-semantic-completion)\n    - [Python Semantic Completion](#python-semantic-completion)\n    - [Rust Semantic Completion](#rust-semantic-completion)\n    - [Go Semantic Completion](#go-semantic-completion)\n    - [JavaScript and TypeScript Semantic Completion](#javascript-and-typescript-semantic-completion)\n    - [Semantic Completion for Other Languages](#semantic-completion-for-other-languages)\n    - [LSP Configuration](#lsp-configuration)\n    - [Writing New Semantic Completers](#writing-new-semantic-completers)\n    - [Diagnostic Display](#diagnostic-display)\n        - [Diagnostic Highlighting Groups](#diagnostic-highlighting-groups)\n    - [Symbol Search](#symbol-search)\n    - [Type/Call Hierarchy](#typecall-hierarchy)\n- [Commands](#commands)\n    - [YcmCompleter subcommands](#ycmcompleter-subcommands)\n        - [GoTo Commands](#goto-commands)\n        - [Semantic Information Commands](#semantic-information-commands)\n        - [Refactoring Commands](#refactoring-commands)\n        - [Miscellaneous Commands](#miscellaneous-commands)\n- [Functions](#functions)\n- [Autocommands](#autocommands)\n- [Options](#options)\n- [FAQ](#faq)\n- [Contributor Code of Conduct](#contributor-code-of-conduct)\n- [Contact](#contact)\n- [License](#license)\n- [Sponsorship](#sponsorship)\n\n\nIntro\n-----\n\nYouCompleteMe is a fast, as-you-type, fuzzy-search code completion,\ncomprehension and refactoring engine for [Vim][].\n\nIt has several completion engines built-in and supports any protocol-compliant\nLanguage Server, so can work with practically any language. YouCompleteMe\ncontains:\n\n- an identifier-based engine that works with every programming language,\n- a powerful [clangd][]-based engine that provides native semantic code\n  completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred to\n  as \"the C-family languages\"),\n- a [Jedi][]-based completion engine for Python 2 and 3,\n- an [OmniSharp-Roslyn][]-based completion engine for C#,\n- a [Gopls][]-based completion engine for Go,\n- a [TSServer][]-based completion engine for JavaScript and TypeScript,\n- a [rust-analyzer][]-based completion engine for Rust,\n- a [jdt.ls][]-based completion engine for Java.\n- a [generic Language Server Protocol implementation for any language](#plugging-an-arbitrary-lsp-server)\n- and an omnifunc-based completer that uses data from Vim's omnicomplete system\n  to provide semantic completions for many other languages (Ruby, PHP, etc.).\n\n![YouCompleteMe GIF completion demo](https://i.imgur.com/0OP4ood.gif)\n\nHere's an explanation of what happened in the last GIF demo above.\n\nFirst, realize that **no keyboard shortcuts had to be pressed** to get the list\nof completion candidates at any point in the demo. The user just types and the\nsuggestions pop up by themselves. If the user doesn't find the completion\nsuggestions relevant and/or just wants to type, they can do so; the completion\nengine will not interfere.\n\nWhen the user sees a useful completion string being offered, they press the TAB\nkey to accept it. This inserts the completion string. Repeated presses of the\nTAB key cycle through the offered completions.\n\nIf the offered completions are not relevant enough, the user can continue typing\nto further filter out unwanted completions.\n\nA critical thing to notice is that the completion **filtering is NOT based on\nthe input being a string prefix of the completion** (but that works too). The\ninput needs to be a _[subsequence][] match_ of a completion. This is a fancy way\nof saying that any input characters need to be present in a completion string in\nthe order in which they appear in the input. So `abc` is a subsequence of\n`xaybgc`, but not of `xbyxaxxc`. After the filter, a complicated sorting system\nranks the completion strings so that the most relevant ones rise to the top of\nthe menu (so you usually need to press TAB just once).\n\n**All of the above works with any programming language** because of the\nidentifier-based completion engine. It collects all of the identifiers in the\ncurrent file and other files you visit (and your tags files) and searches them\nwhen you type (identifiers are put into per-filetype groups).\n\nThe demo also shows the semantic engine in use. When the user presses `.`, `-\u003e`\nor `::` while typing in insert mode (for C++; different triggers are used for\nother languages), the semantic engine is triggered (it can also be triggered\nwith a keyboard shortcut; see the rest of the docs).\n\nThe last thing that you can see in the demo is YCM's diagnostic display features\n(the little red X that shows up in the left gutter; inspired by [Syntastic][])\nif you are editing a C-family file. As the completer engine compiles your file\nand detects warnings or errors, they will be presented in various ways. You\ndon't need to save your file or press any keyboard shortcut to trigger this, it\n\"just happens\" in the background.\n\n**And that's not all...**\n\nYCM might be the only Vim completion engine with the correct Unicode support.\nThough we do assume UTF-8 everywhere.\n\n![YouCompleteMe GIF unicode demo](https://user-images.githubusercontent.com/10026824/34471853-af9cf32a-ef53-11e7-8229-de534058ddc4.gif)\n\nYCM also provides [semantic IDE-like features](#quick-feature-summary) in a\nnumber of languages, including:\n\n- displaying signature help (argument hints) when entering the arguments to a\n  function call (Vim only)\n- [finding declarations, definitions, usages](#goto-commands), etc.\n  of identifiers, and an [interactive symbol finder](#symbol-search)\n- [displaying type information](#the-gettype-subcommand) for classes,\n  variables, functions etc.,\n- displaying documentation for methods, members, etc. in the [preview\n  window](#the-getdoc-subcommand), or in a\n  [popup next to the cursor](#the-gycm_auto_hover-option) (Vim only)\n- [fixing common coding errors](#the-fixit-subcommand), like missing\n  semi-colons, typos, etc.,\n- [semantic renaming](#the-refactorrename-subcommand) of variables across files,\n- formatting code,\n- removing unused imports, sorting imports, etc.\n\nFor example, here's a demo of signature help:\n\n![Signature Help Early Demo](https://user-images.githubusercontent.com/10584846/58738348-5060da80-83fd-11e9-9537-d07fdbf4554c.gif)\n\nBelow we can see YCM being able to do a few things:\n\n- Retrieve references across files\n- Go to declaration/definition\n- Expand `auto` in C++\n- Fix some common errors, and provide refactorings, with `FixIt`\n- Not shown in the GIF are `GoToImplementation` and `GoToType`\n  for servers that support it.\n\n![YouCompleteMe GIF subcommands demo](https://i.imgur.com/nmUUbdl.gif)\n\nAnd here's some documentation being shown in a hover popup, automatically and\nmanually:\n\n![hover demo](https://user-images.githubusercontent.com/10584846/80312146-91af6500-87db-11ea-996b-7396f3134d1f.gif)\n\nFeatures vary by file type, so make sure to check out the [file type feature\nsummary](#quick-feature-summary) and the\n[full list of completer subcommands](#ycmcompleter-subcommands) to\nfind out what's available for your favourite languages.\n\nYou'll also find that YCM has filepath completers (try typing `./` in a file)\nand a completer that integrates with [UltiSnips][].\n\nInstallation\n------------\n\n### Requirements\n\n| Runtime | Min Version | Recommended Version (full support) | Python |\n|---------|-------------|------------------------------------|--------|\n| Vim     | 9.1.0016    | 9.1.0016                           | 3.8    |\n| Neovim  | 0.5         | Vim 9.1.0016                       | 3.8    |\n\n#### Supported Vim Versions\n\nOur policy is to support the Vim version that's in the latest LTS of Ubuntu.\n\nVim must have a [working Python 3 runtime](#supported-python-runtime).\n\nFor Neovim users, our policy is to require the latest released version.\nCurrently, Neovim 0.5.0 is required.  Please note that some features are not\navailable in Neovim, and Neovim is not officially supported.\n\n#### Supported Python runtime\n\nYCM has two components: A server and a client. Both the server and client\nrequire Python 3.8 or later 3.x release. \n\nFor the Vim client, Vim must be, compiled with `--enable-shared` (or\n`--enable-framework` on macOS). You can check if this is working with `:py3\nimport sys; print( sys.version)`. It should say something like `3.8.2 (...)`.\n\nFor Neovim, you must have a python 3.8 runtime and the Neovim python\nextensions. See Neovim's `:help provider-python` for how to set that up.\n\nFor the server, you must run the `install.py` script with a python 3.8 (or\nlater) runtime. Anaconda etc. are not supported. YCM will remember the runtime\nyou used to run `install.py` and will use that when launching the server, so if\nyou usually use anaconda, then make sure to use the full path to a real cpython3,\ne.g. `/usr/bin/python3 install.py --all` etc.\n\nOur policy is to support the python3 version that's available in the latest\nUbuntu LTS (similar to our Vim version policy). We don't increase the Python\nruntime version without a reason, though. Typically, we do this when the current\npython version we're using goes out of support. At that time we will typically\npick a version that will be supported for a number of years.\n\n#### Supported Compilers\n\nIn order to provide the best possible performance and stability, ycmd has\nupdated its code to C++17. This requires a version bump of the minimum\nsupported compilers. The new requirements are:\n\n| Compiler | Current Min    |\n|----------|----------------|\n| GCC      | 8              |\n| Clang    | 7              |\n| MSVC     | 15.7 (VS 2017) |\n\nYCM requires CMake 3.13 or greater. If your CMake is too old, you may be able to\nsimply `pip install --user cmake` to get a really new version.\n\n#### Individual completer requirements\n\nWhen enabling language support for a particular language, there may be runtime\nrequirements, such as needing a very recent Java Development Kit for Java\nsupport. In general, YCM is not in control of the required versions for the\ndownstream compilers, though we do our best to signal where we know them.\n\n### macOS\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install CMake, MacVim and Python 3; Note that the pre-installed *macOS system*\n  Vim is not supported (due to it having broken Python integration).\n\n```\n$ brew install cmake python go nodejs\n```\n\n- Install mono from [Mono Project](mono-install-macos) (NOTE: on Intel Macs you\n  can also `brew install mono`. On arm Macs, you may require Rosetta)\n\n- For Java support you must install a JDK, one way to do this is with Homebrew:\n\n```\n$ brew install java\n$ sudo ln -sfn $(brew --prefix java)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk\n```\n\n- Pre-installed macOS *system* Vim does not support Python 3. So you need to\n  install either a Vim that supports Python 3 OR [MacVim][] with\n  [Homebrew][brew]:\n\n  - Option 1: Installing a Vim that supports Python 3\n  \n  ```\n  brew install vim\n  ```\n\n  - Option 2: Installing [MacVim][]\n  \n  ```\n  brew install macvim\n  ```\n\n- Compile YCM.\n\n  - For Intel and arm64 Macs, the bundled libclang/clangd work:\n\n    ```\n    cd ~/.vim/bundle/YouCompleteMe\n    python3 install.py --all\n    ```\n\n  - If you have troubles with finding system frameworks or C++ standard library,\n    try using the homebrew llvm:\n\n    ```\n    brew install llvm\n    cd ~/.vim/bundle/YouCompleteMe\n    python3 install.py --system-libclang --all\n    ```\n\n    And edit your vimrc to add the following line to use the Homebrew llvm's\n    clangd:\n\n    ```viml\n    \" Use homebrew's clangd\n    let g:ycm_clangd_binary_path = trim(system('brew --prefix llvm')).'/bin/clangd'\n    ```\n\n\n- For using an arbitrary LSP server, check [the relevant\n  section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\nA supported Vim version with Python 3 is required. [MacVim][] is a good option,\neven if you only use the terminal. YCM won't work with the pre-installed Vim\nfrom Apple as its Python support is broken. If you don't already use a Vim\nthat supports Python 3 or [MacVim][], install it with [Homebrew][brew]. Install\nCMake as well:\n\n    brew install vim cmake     \n    \n   OR\n\n    brew install macvim cmake\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (happens\nrarely), YCM will notify you to recompile it. You should then rerun the install\nprocess.\n\n**NOTE:** If you want C-family completion, you MUST have the latest Xcode\ninstalled along with the latest Command Line Tools (they are installed\nautomatically when you run `clang` for the first time, or manually by running\n`xcode-select --install`)\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py\n```\n\n\nThe following additional language support options are available:\n\n- C# support: install by downloading the [Mono macOS package][mono-install-macos]\n  and add `--cs-completer` when calling `install.py`.\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `xbuild`, `go`, `node` and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py --all\n```\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Linux 64-bit\n\nThe following assume you're using Ubuntu 24.04.\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install CMake, Vim and Python\n\n```\napt install build-essential cmake vim-nox python3-dev\n```\n\n- Install mono-complete, go, node, java, and npm\n\n```\napt install mono-complete golang nodejs openjdk-17-jdk openjdk-17-jre npm\n```\n\n- Compile YCM\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --all\n```\n\n- For plugging an arbitrary LSP server, check [the relevant section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\nMake sure you have a supported version of Vim with Python 3 support and a\nsupported compiler. The latest LTS of Ubuntu is the minimum platform for simple\ninstallation. For earlier releases or other distributions, you may have to do\nsome work to acquire the dependencies.\n\nIf your Vim version is too old, you may need to [compile Vim from\nsource][vim-build] (don't worry, it's easy).\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (which happens rarely), YCM\nwill notify you to recompile it. You should then rerun the installation process.\n\nInstall development tools, CMake, and Python headers:\n\n- Fedora-like distributions:\n\n```\nsudo dnf install cmake gcc-c++ make python3-devel\n```\n\n- Ubuntu LTS:\n\n```\nsudo apt install build-essential cmake3 python3-dev\n```\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py\n```\n\nThe following additional language support options are available:\n\n- C# support: install [Mono][mono-install-linux] and add `--cs-completer`\n  when calling `install.py`.\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `xbuild`, `go`, `node`, and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --all\n```\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Windows\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install [Visual Studio Build Tools 2019][visual-studio-download]\n- Install CMake, Vim and Python\n- Install go, node and npm\n- Compile YCM\n\n```\ncd YouCompleteMe\npython3 install.py --all\n```\n\n- Add `set encoding=utf-8` to your [vimrc][]\n- For plugging an arbitrary LSP server, check [the relevant section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\n**Important:** we assume that you are using the `cmd.exe` command prompt and\nthat you know how to add an executable to the PATH environment variable.\n\nMake sure you have a supported Vim version with Python 3 support. You\ncan check the version and which Python is supported by typing `:version` inside\nVim. Look at the features included: `+python3/dyn` for Python 3.\nTake note of the Vim architecture, i.e. 32 or\n64-bit. It will be important when choosing the Python installer. We recommend\nusing a 64-bit client. [Daily updated installers of 32-bit and 64-bit Vim with\nPython 3 support][vim-win-download] are available.\n\nAdd the following line to your [vimrc][] if not already present.:\n\n```viml\nset encoding=utf-8\n```\n\nThis option is required by YCM. Note that it does not prevent you from editing a\nfile in another encoding than UTF-8.  You can do that by specifying [the `++enc`\nargument][++enc] to the `:e` command.\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (happens\nrarely), YCM will notify you to recompile it. You should then rerun the install\nprocess.\n\nDownload and install the following software:\n\n- [Python 3][python-win-download]. Be sure to pick the version\n  corresponding to your Vim architecture. It is _Windows x86_ for a 32-bit Vim\n  and _Windows x86-64_ for a 64-bit Vim. We recommend installing Python 3.\n  Additionally, the version of Python you install must match up exactly with\n  the version of Python that Vim is looking for. Type `:version` and look at the\n  bottom of the page at the list of compiler flags. Look for flags that look\n  similar to `-DDYNAMIC_PYTHON3_DLL=\\\"python36.dll\\\"`. This indicates\n  that Vim is looking for Python 3.6. You'll need one or the other installed,\n  matching the version number exactly.\n- [CMake][cmake-download]. Add CMake executable to the PATH environment\n  variable.\n- [Build Tools for Visual Studio 2019][visual-studio-download]. During setup,\n  select _C++ build tools_ in _Workloads_.\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py\n```\n\nThe following additional language support options are available:\n\n- C# support: add `--cs-completer` when calling `install.py`.\n  Be sure that [the build utility `msbuild` is in your PATH][add-msbuild-to-path].\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `msbuild`, `go`, `node` and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py --all\n```\n\nYou can specify the Microsoft Visual C++ (MSVC) version using the `--msvc`\noption. YCM officially supports MSVC 15 (2017), MSVC 16 (Visual Studio 2019) \nand MSVC 17 (Visual Studio 17 2022).\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Full Installation Guide\n\nThe [full installation guide][wiki-full-install] has been moved to the wiki.\n\nQuick Feature Summary\n-----\n\n### General (all languages)\n\n* Super-fast identifier completer including tags files and syntax elements\n* Intelligent suggestion ranking and filtering\n* File and path suggestions\n* Suggestions from Vim's omnifunc\n* UltiSnips snippet suggestions\n\n### C-family languages (C, C++, Objective C, Objective C++, CUDA)\n\n* Semantic auto-completion with automatic fixes\n* Signature help\n* Real-time diagnostic display\n* Go to include/declaration/definition (`GoTo`, etc.)\n* Go to alternate file (e.g. associated header `GoToAlternateFile`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Reference finding (`GoToReferences`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Semantic highlighting\n* Inlay hints\n* Type hierarchy\n* Call hierarchy\n\n### C♯\n\n* Semantic auto-completion\n* Signature help\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Management of OmniSharp-Roslyn server instance\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n\n### Python\n\n* Semantic auto-completion\n* Signature help\n* Go to definition (`GoTo`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n\n### Go\n\n* Semantic auto-completion\n* Signature help\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Code formatting (`Format`)\n* Management of `gopls` server instance\n* Inlay hints\n* Call hierarchy\n\n### JavaScript and TypeScript\n\n* Semantic auto-completion with automatic import insertion\n* Signature help\n* Real-time diagnostic display\n* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are\n  identical)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors and perform refactoring (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Management of `TSServer` server instance\n* Inlay hints\n* Call hierarchy\n\n### Rust\n\n* Semantic auto-completion\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to implementation (`GoToImplementation`)\n* Reference finding (`GoToReferences`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Type information for identifiers (`GetType`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Management of `rust-analyzer` server instance\n* Semantic highlighting\n* Inlay hints\n* Call hierarchy\n\n### Java\n\n* Semantic auto-completion with automatic import insertion\n* Signature help\n* Real-time diagnostic display\n* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are\n  identical)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors including code generation (`FixIt`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Detection of Java projects\n* Execute custom server command (`ExecuteCommand \u003cargs\u003e`)\n* Management of `jdt.ls` server instance\n* Semantic highlighting\n* Inlay hints\n* Type hierarchy\n* Call hierarchy\n\nUser Guide\n----------\n\n### General Usage\n\nIf the offered completions are too broad, keep typing characters; YCM will\ncontinue refining the offered completions based on your input.\n\nFiltering is \"smart-case\" and \"smart-[diacritic][]\" sensitive; if you are\ntyping only lowercase letters, then it's case-insensitive. If your input\ncontains uppercase letters, then the uppercase letters in your query must\nmatch uppercase letters in the completion strings (the lowercase letters still\nmatch both). On top of that, a letter with no diacritic marks will match that\nletter with or without marks:\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n  \u003cth\u003ematches\u003c/th\u003e\n  \u003cth\u003efoo\u003c/th\u003e\n  \u003cth\u003efôo\u003c/th\u003e\n  \u003cth\u003efOo\u003c/th\u003e\n  \u003cth\u003efÔo\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efoo\u003c/th\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efôo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efOo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efÔo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nUse the TAB key to accept a completion and continue pressing TAB to cycle\nthrough the completions. Use Shift-TAB to cycle backward. Note that if you're\nusing console Vim (that is, not gvim or MacVim) then it's likely that the\nShift-TAB binding will not work because the console will not pass it to Vim.\nYou can remap the keys; see the [Options](#options) section below.\n\nKnowing a little bit about how YCM works internally will prevent confusion. YCM\nhas several completion engines: an identifier-based completer that collects all\nof the identifiers in the current file and other files you visit (and your tags\nfiles) and searches them when you type (identifiers are put into per-filetype\ngroups).\n\nThere are also several semantic engines in YCM. There are libclang-based and\nclangd-based completers that provide semantic completion for C-family languages.\nThere's a Jedi-based completer for semantic completion for Python. There's also\nan omnifunc-based completer that uses data from Vim's omnicomplete system to\nprovide semantic completions when no native completer exists for that language\nin YCM.\n\nThere are also other completion engines, like the UltiSnips completer and the\nfilepath completer.\n\nYCM automatically detects which completion engine would be the best in any\nsituation. On occasion, it queries several of them at once, merges the\noutputs and presents the results to you.\n\n### Client-Server Architecture\n\nYCM has a client-server architecture; the Vim part of YCM is only a thin client\nthat talks to the [ycmd HTTP+JSON server][ycmd] that has the vast majority of\nYCM logic and functionality. The server is started and stopped automatically as\nyou start and stop Vim.\n\n### Completion String Ranking\n\nThe subsequence filter removes any completions that do not match the input, but\nthen the sorting system kicks in. It's actually very complicated and uses lots\nof factors, but suffice it to say that \"word boundary\" (WB) subsequence\ncharacter matches are \"worth\" more than non-WB matches. In effect, this means\nthat given an input of \"gua\", the completion \"getUserAccount\" would be ranked higher\nin the list than the \"Fooguxa\" completion (both of which are subsequence\nmatches). Word-boundary characters are all capital characters, characters\npreceded by an underscore, and the first letter character in the completion\nstring.\n\n### Signature Help\n\nValid signatures are displayed in a second popup menu and the current signature\nis highlighted along with the current argument.\n\nSignature help is triggered in insert mode automatically when\n`g:ycm_auto_trigger` is enabled and is not supported when it is not enabled.\n\nThe signatures popup is hidden when there are no matching signatures or when you\nleave insert mode. If you want to manually control when it is visible, you can\nmap something to `\u003cplug\u003eYCMToggleSignatureHelp` (see below).\n\nFor more details on this feature and a few demos, check out the\n[PR that proposed it][signature-help-pr].\n\n#### Dismiss signature help\n\nThe signature help popup sometimes gets in the way. You can toggle its\nvisibility with a mapping. YCM provides the \"Plug\" mapping\n`\u003cPlug\u003e(YCMToggleSignatureHelp)` for this.\n\nFor example, to hide/show the signature help popup by pressing Ctrl+l in insert\nmode: `imap \u003csilent\u003e \u003cC-l\u003e \u003cPlug\u003e(YCMToggleSignatureHelp)`.\n\n_NOTE_: No default mapping is provided because insert mappings are very\ndifficult to create without breaking or overriding some existing functionality.\nCtrl-l is not a suggestion, just an example.\n\n### Semantic highlighting\n\nSemantic highlighting is the process where the buffer text is coloured according\nto the underlying semantic type of the word, rather than classic syntax\nhighlighting based on regular expressions. This can be powerful additional data\nthat we can process very quickly.\n\nThis feature is only supported in Vim.\n\nFor example, here is a function with classic highlighting:\n\n![highliting-classic](https://user-images.githubusercontent.com/10584846/173137003-a265e8b0-84db-4993-98f0-03ee81b9de94.png)\n\nAnd here is the same function with semantic highlighting:\n\n![highliting-semantic](https://user-images.githubusercontent.com/10584846/173137012-7547de0b-145f-45fa-ace3-18943acd2141.png)\n\nAs you can see, the function calls, macros, etc. are correctly identified. \n\nThis can be enabled globally with `let g:ycm_enable_semantic_highlighting=1` or\nper buffer, by setting `b:ycm_enable_semantic_highlighting`.\n\n#### Customising the highlight groups\n\nYCM uses text properties (see `:help text-prop-intro`) for semantic\nhighlighting. In order to customise the coloring, you can define the text\nproperties that are used.\n\nIf you define a text property named `YCM_HL_\u003ctoken type\u003e`, then it will be used\nin place of the defaults. The `\u003ctoken type\u003e` is defined as the Language Server\nProtocol semantic token type, defined in the [LSP Spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens).\n\nSome servers also use custom values. In this case, YCM prints a warning\nincluding the token type name that you can customise.\n\nFor example, to render `parameter` tokens using the `Normal` highlight group,\nyou can do this:\n\n```viml\ncall prop_type_add( 'YCM_HL_parameter', { 'highlight': 'Normal' } )\n```\n\nMore generally, this pattern can be useful for customising the groups:\n\n```viml\nlet MY_YCM_HIGHLIGHT_GROUP = {\n      \\   'typeParameter': 'PreProc',\n      \\   'parameter': 'Normal',\n      \\   'variable': 'Normal',\n      \\   'property': 'Normal',\n      \\   'enumMember': 'Normal',\n      \\   'event': 'Special',\n      \\   'member': 'Normal',\n      \\   'method': 'Normal',\n      \\   'class': 'Special',\n      \\   'namespace': 'Special',\n      \\ }\n\nfor tokenType in keys( MY_YCM_HIGHLIGHT_GROUP )\n  call prop_type_add( 'YCM_HL_' . tokenType,\n                    \\ { 'highlight': MY_YCM_HIGHLIGHT_GROUP[ tokenType ] } )\nendfor\n```\n\n## Inlay hints\n\n**NOTE**: Highly experimental feature, requiring Vim 9.0.214 or later (not\nsupported in NeoVim).\n\nWhen `g:ycm_enable_inlay_hints` (globally) or `b:ycm_enable_inlay_hints` (for a\nspecific buffer) is set to `1`, then YCM will insert inlay hints as supported by\nthe language semantic engine.\n\nAn inlay hint is text that is rendered on the screen that is not part of the buffer and\nis often used to mark up the type or name of arguments, parameters, etc. which\nhelp the developer understand the semantics of the code.\n\nHere are some examples:\n\n* C\n\n![c-inlay](https://user-images.githubusercontent.com/10584846/185708054-68074fc0-e50c-4a65-887c-da6f372b8982.png)\n\n* TypeScript\n\n![ts-inlay](https://user-images.githubusercontent.com/10584846/185708156-b52970ce-005f-4f0b-97e7-bdf8feeefedc.png)\n\n* Go\n\n![go-inlay](https://user-images.githubusercontent.com/10584846/185708242-e42dab6f-1847-46f1-8585-2d9f2c8a76dc.png)\n\n### Highlight groups\n\nBy default, YCM renders the inlay hints with the `NonText` highlight group. To\noverride this, define the `YcmInlayHint` highlight yourself, e.g. in your\n`.vimrc`:\n\n```viml\nhi link YcmInlayHint Comment\n```\n\nSimilar to semantic highlighting above, you can override specific highlighting\nfor different inlay hint types by defining text properties named after the kind\nof inlay hint, for example:\n\n```viml\ncall prop_type_add( 'YCM_INLAY_Type', #{ highlight: 'Comment' } )\n```\n\nThe list of inlay hint kinds can be found in `python/ycm/inlay_hints.py`\n\n### Options\n\n* `g:ycm_enable_inlay_hints` or `b:ycm_enable_inlay_hints` - enable/disable\n  globally or for local buffer\n* `g:ycm_clear_inlay_hints_in_insert_mode` - set to `1` to remove all inlay\n  hints when entering insert mode and reinstate them when leaving insert mode\n\n### Toggling\n\nInlay hints can add a lot of text to the screen and may be distracting. You can\ntoggle them on/off instantly, by mapping something to\n`\u003cPlug\u003e(YCMToggleInlayHints)`, for example:\n\n```viml\nnnoremap \u003csilent\u003e \u003clocalleader\u003eh \u003cPlug\u003e(YCMToggleInlayHints)\n```\n\nNo default mapping is provided for this due to the personal nature of mappings.\n\n### General Semantic Completion\n\nYou can use Ctrl+Space to trigger the completion suggestions anywhere, even\nwithout a string prefix. This is useful to see which top-level functions are\navailable for use.\n\n### C-family Semantic Completion\n\n**NOTE:** YCM originally used the `libclang` based engine for C-family, but\nusers should migrate to clangd, as it provides more features and better\nperformance. Users who rely on `override_filename` in their `.ycm_extra_conf.py`\nwill need to stay on the old `libclang` engine. Instructions on how to stay on\nthe old engine are available on [the wiki][libclang-instructions].\n\nSome of the features of clangd:\n\n- **Project wide indexing**: Clangd has both dynamic and static index support.\n  The dynamic index stores up-to-date symbols coming from any files you are\n  currently editing, whereas static index contains project-wide symbol\n  information. This symbol information is used for code completion and code\n  navigation. Whereas libclang is limited to the current translation unit(TU).\n- **Code navigation**: Clangd provides all the GoTo requests libclang provides and it\n  improves those using the above-mentioned index information to contain\n  project-wide information rather than just the current TU.\n- **Rename**: Clangd can perform semantic rename operations on the current\n  file, whereas libclang doesn't support such functionality.\n- **Code Completion**: Clangd can perform code completions at a lower latency\n  than libclang; also, it has information about all the symbols in your\n  project so it can suggest items outside your current TU and also provides\n  proper `#include` insertions for those items.\n- **Signature help**: Clangd provides signature help so that you can see the\n  names and types of arguments when calling functions.\n- **Format Code**: Clangd provides code formatting either for the selected\n  lines or the whole file, whereas libclang doesn't have such functionality.\n- **Performance**: Clangd has faster re-parse and code completion times\n  compared to libclang.\n\n#### Installation\n\nOn supported architectures, the `install.py` script will download a suitable\nclangd (`--clangd-completer`) or libclang (`--clang-completer`) for you.\nSupported architectures are:\n\n* Linux glibc \u003e= 2.39 (Intel, armv7-a, aarch64) - built on ubuntu 24.04\n* MacOS \u003e=10.15 (Intel, arm64)\n  - For Intel, compatibility per clang.llvm.org downloads\n  - For arm64, macOS 10.15+\n* Windows (Intel) - compatibility per clang.llvm.org downloads\n\n***clangd***:\n\nTypically, clangd is installed by the YCM installer (either with `--all` or with\n`--clangd-completer`). This downloads a pre-built `clangd` binary for your\narchitecture. If your OS or architecture is not supported or is too old, you can\ninstall a compatible `clangd` and use [`g:ycm_clangd_binary_path`]() to point to\nit.\n\n***libclang***:\n\n`libclang` can be enabled also with `--all` or `--clang-completer`. As with\n`clangd`, YCM will try and download a version of `libclang` that is suitable for\nyour environment, but again if your environment can't be supported, you can\nbuild or acquire `libclang` for yourself and specify it when building, as:\n\n```\n$ EXTRA_CMAKE_ARGS='-DPATH_TO_LLVM_ROOT=/path/to/your/llvm' ./install.py --clang-completer --system-libclang\n```\n\nPlease note that if using custom `clangd` or `libclang` it _must_ match the\nversion that YCM requires. Currently YCM requires ***clang 17.0.1***.\n\n#### Compile flags\n\nIn order to perform semantic analysis such as code completion, `GoTo`, and\ndiagnostics, YouCompleteMe uses `clangd`, which makes use of\nclang compiler, sometimes also referred to as LLVM. Like any compiler,\nclang also requires a set of compile flags in order to parse your code. Simply\nput: If clang can't parse your code, YouCompleteMe can't provide semantic\nanalysis.\n\nThere are 2 methods that can be used to provide compile flags to clang:\n\n#### Option 1: Use a [compilation database][compdb]\n\nThe easiest way to get YCM to compile your code is to use a compilation\ndatabase.  A compilation database is usually generated by your build system\n(e.g. `CMake`) and contains the compiler invocation for each compilation unit in\nyour project.\n\nFor information on how to generate a compilation database, see the [clang\ndocumentation][compdb]. In short:\n\n- If using CMake, add `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` when configuring (or\n  add `set( CMAKE_EXPORT_COMPILE_COMMANDS ON )` to `CMakeLists.txt`) and copy or\n  symlink the generated database to the root of your project.\n- If using Ninja, check out the `compdb` tool (`-t compdb`) in its\n  [docs][ninja-compdb].\n- If using GNU make, check out [compiledb][] or [Bear][].\n- For other build systems, check out\n  [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) below.\n\nIf no [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) is found,\nYouCompleteMe automatically tries to load a compilation database if there is\none.\n\nYCM looks for a file named `compile_commands.json` in the directory of the\nopened file or in any directory above it in the hierarchy (recursively); when\nthe file is found before a local `.ycm_extra_conf.py`, YouCompleteMe stops\nsearching the directories and lets clangd take over and handle the flags.\n\n#### Option 2: Provide the flags manually\n\nIf you don't have a compilation database or aren't able to generate one,\nyou have to tell YouCompleteMe how to compile your code some other way.\n\nEvery C-family project is different. It is not possible for YCM to guess what\ncompiler flags to supply for your project. Fortunately, YCM provides a mechanism\nfor you to generate the flags for a particular file with _arbitrary complexity_.\nThis is achieved by requiring you to provide a Python module that implements a\ntrivial function that, given the file name as an argument, returns a list of\ncompiler flags to use to compile that file.\n\nYCM looks for a `.ycm_extra_conf.py` file in the directory of the opened file or\nin any directory above it in the hierarchy (recursively); when the file is\nfound, it is loaded (only once!) as a Python module. YCM calls a `Settings`\nmethod in that module which should provide it with the information necessary to\ncompile the current file. You can also provide a path to a global configuration\nfile with the\n[`g:ycm_global_ycm_extra_conf`](#the-gycm_global_ycm_extra_conf-option) option,\nwhich will be used as a fallback. To prevent the execution of malicious code\nfrom a file you didn't write YCM will ask you once per `.ycm_extra_conf.py` if\nit is safe to load. This can be disabled and you can white-/blacklist files. See\nthe [`g:ycm_confirm_extra_conf`](#the-gycm_confirm_extra_conf-option) and\n[`g:ycm_extra_conf_globlist`](#the-gycm_extra_conf_globlist-option) options\nrespectively.\n\nThis system was designed this way so that the user can perform any arbitrary\nsequence of operations to produce a list of compilation flags YCM should hand\nto Clang.\n\n**NOTE**: It is highly recommended to include `-x \u003clanguage\u003e` flag to libclang.\nThis is so that the correct language is detected, particularly for header files.\nCommon values are `-x c` for C, `-x c++` for C++, `-x objc` for Objective-C, and\n`-x cuda` for CUDA.\n\nTo give you an impression, if your C++ project is trivial, and your usual\ncompilation command is: `g++ -Wall -Wextra -Werror -o FILE.o FILE.cc`, then the\nfollowing `.ycm_extra_conf.py` is enough to get semantic analysis from\nYouCompleteMe:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-Werror' ],\n  }\n```\n\nAs you can see from the trivial example, YCM calls the `Settings` method which\nreturns a dictionary with a single element `'flags'`. This element is a `list`\nof compiler flags to pass to libclang for the current file. The absolute path of\nthat file is accessible under the `filename` key of the `kwargs` dictionary.\nThat's it! This is actually enough for most projects, but for complex projects\nit is not uncommon to integrate directly with an existing build system using the\nfull power of the Python language.\n\nFor a more elaborate example,\n[see ycmd's own `.ycm_extra_conf.py`][ycmd_flags_example]. You should be able to\nuse it _as a starting point_. **Don't** just copy/paste that file somewhere and\nexpect things to magically work; **your project needs different flags**. Hint:\njust replace the strings in the `flags` variable with compilation flags\nnecessary for your project. That should be enough for 99% of projects.\n\nYou could also consider using [YCM-Generator][ygen] to generate the\n`ycm_extra_conf.py` file.\n\n#### Errors during compilation\n\nIf Clang encounters errors when compiling the header files that your file\nincludes, then it's probably going to take a long time to get completions.  When\nthe completion menu finally appears, it's going to have a large number of\nunrelated completion strings (type/function names that are not actually\nmembers). This is because Clang fails to build a precompiled preamble for your\nfile if there are any errors in the included headers and that preamble is key to\ngetting fast completions.\n\nCall the `:YcmDiags` command to see if any errors or warnings were detected in\nyour file.\n\n### Java Semantic Completion\n\n#### Java Quick Start\n\n1. Ensure that you have enabled the Java completer. See the\n   [installation guide](#installation) for details.\n\n2. Create a project file (gradle or maven) file in the root directory of your\n   Java project, by following the instructions below.\n\n3. (Optional) [Configure the LSP server](#lsp-configuration). The [jdt.ls\n   configuration options][jdtls-preferences] can be found in their codebase.\n\n4. If you previously used Eclim or Syntastic for Java, disable them for Java.\n\n5. Edit a Java file from your project.\n\n#### Java Project Files\n\nIn order to provide semantic analysis, the Java completion engine requires\nknowledge of your project structure. In particular, it needs to know the class\npath to use, when compiling your code. Fortunately [jdt.ls][]\nsupports [eclipse project files][eclipse-project],\n[maven projects][mvn-project] and [gradle projects][gradle-project].\n\n**NOTE:** Our recommendation is to use either Maven or Gradle projects.\n\n#### Diagnostic display - Syntastic\n\nThe native support for Java includes YCM's native real-time diagnostics display.\nThis can conflict with other diagnostics plugins like Syntastic, so when\nenabling Java support, please **manually disable Syntastic Java diagnostics**.\n\nAdd the following to your `vimrc`:\n\n```viml\nlet g:syntastic_java_checkers = []\n```\n\n#### Diagnostic display - Eclim\n\nThe native support for Java includes YCM's native real-time diagnostics display.\nThis can conflict with other diagnostics plugins like Eclim, so when enabling\nJava support, please **manually disable Eclim Java diagnostics**.\n\nAdd the following to your `vimrc`:\n\n```viml\nlet g:EclimFileTypeValidate = 0\n```\n\n**NOTE**: We recommend disabling Eclim entirely when editing Java with YCM's\nnative Java support. This can be done temporarily with `:EclimDisable`.\n\n#### Eclipse Projects\n\nEclipse-style projects require two files: [.project][eclipse-dot-project] and\n[.classpath][eclipse-dot-classpath].\n\nIf your project already has these files due to previously being set up within\nEclipse, then no setup is required. [jdt.ls][] should load the project just\nfine (it's basically eclipse after all).\n\nHowever, if not, it is possible (easy in fact) to craft them manually, though it\nis not recommended. You're better off using Gradle or Maven (see below).\n\n[A simple eclipse style project example][ycmd-eclipse-project] can be found in\nthe ycmd test directory. Normally all that is required is to copy these files to\nthe root of your project and to edit the `.classpath` to add additional\nlibraries, such as:\n\n```xml\n  \u003cclasspathentry kind=\"lib\" path=\"/path/to/external/jar\" /\u003e\n  \u003cclasspathentry kind=\"lib\" path=\"/path/to/external/java/source\" /\u003e\n```\n\nIt may also be necessary to change the directory in which your source files are\nlocated (paths are relative to the .project file itself):\n\n```xml\n  \u003cclasspathentry kind=\"src\" output=\"target/classes\" path=\"path/to/src/\" /\u003e\n```\n\n**NOTE**: The eclipse project and classpath files are not a public interface\nand it is highly recommended to use Maven or Gradle project definitions if you\ndon't already use Eclipse to manage your projects.\n\n#### Maven Projects\n\nMaven needs a file named [pom.xml][mvn-project] in the root of the project.\nOnce again a simple [pom.xml][ycmd-mvn-pom-xml] can be found in the ycmd source.\n\nThe format of [pom.xml][mvn-project] files is way beyond the scope of this\ndocument, but we do recommend using the various tools that can generate them for\nyou, if you're not familiar with them already.\n\n#### Gradle Projects\n\nGradle projects require a [build.gradle][gradle-project]. Again, there is a\n[trivial example in ycmd's tests][ycmd-gradle-project].\n\nThe format of [build.gradle][gradle-project] files are way beyond the scope of\nthis document, but we do recommend using the various tools that can generate\nthem for you if you're not familiar with them already.\n\nSome users have experienced issues with their jdt.ls  when using the Groovy\nlanguage for their build.gradle. As such, try using\n[Kotlin](https://github.com/ycm-core/lsp-examples#kotlin) instead.\n\n#### Troubleshooting\n\nIf you're not getting completions or diagnostics, check the server health:\n\n* The Java completion engine takes a while to start up and parse your project.\n  You should be able to see its progress in the command line, and\n  `:YcmDebugInfo`. Ensure that the following lines are present:\n\n```\n--   jdt.ls Java Language Server running\n--   jdt.ls Java Language Server Startup Status: Ready\n```\n\n* If the above lines don't appear after a few minutes, check the jdt.ls and ycmd\n  log files using [`:YcmToggleLogs` ](#the-ycmtogglelogs-command). The jdt.ls\n  log file is called `.log` (for some reason).\n\nIf you get a message about \"classpath is incomplete\", then make sure you have\ncorrectly configured the [project files](#java-project-files).\n\nIf you get messages about unresolved imports, then make sure you have\ncorrectly configured the [project files](#java-project-files), in particular\ncheck that the classpath is set correctly.\n\n### C# Semantic Completion\n\nYCM relies on [OmniSharp-Roslyn][] to provide completion and code navigation.\nOmniSharp-Roslyn needs a solution file for a C# project and there are two ways\nof letting YCM know about your solution files.\n\n#### Automatically discovered solution files\n\nYCM will scan all parent directories of the file currently being edited and look\nfor a file with `.sln` extension.\n\n#### Manually specified solution files\n\nIf YCM loads `.ycm_extra_conf.py` which contains `CSharpSolutionFile` function,\nYCM will try to use that to determine the solution file. This is useful when one\nwants to override the default behaviour and specify a solution file that is not\nin any of the parent directories of the currently edited file. Example:\n\n```python\ndef CSharpSolutionFile( filepath ):\n  # `filepath` is the path of the file user is editing\n  return '/path/to/solution/file' # Can be relative to the `.ycm_extra_conf.py`\n```\n\nIf the path returned by `CSharpSolutionFile` is not an actual file, YCM will\nfall back to the other way of finding the file.\n\n#### Use with .NET 6.0 and .NET SDKs\n\nYCM ships with older version of OmniSharp-Roslyn based on Mono runtime.\nIt is possible to use it with .NET 6.0 and newer, but it requires manual setup.\n\n1. Download NET 6.0 version of the OmniSharp server for your system from\n[releases](https://github.com/OmniSharp/omnisharp-roslyn/releases/)\n1. Set `g:ycm_roslyn_binary_path` to the unpacked executable `OmniSharp`\n1. Create a solution file if one doesn't already exist, it is currently required\nby YCM for internal bookkeeping\n    1. Run `dotnet new sln` at the root of your project\n    1. Run `dotnet sln add \u003cproject1.csproj\u003e \u003cproject2.csproj\u003e ...`\n    for all of your projects\n1. Run `:YcmRestartServer`\n\n### Python Semantic Completion\n\nYCM relies on the [Jedi][] engine to provide completion and code navigation. By\ndefault, it will pick the version of Python running the [ycmd server][ycmd] and\nuse its `sys.path`. While this is fine for simple projects, this needs to be\nconfigurable when working with virtual environments or in a project with\nthird-party packages. The next sections explain how to do that.\n\n#### Working with virtual environments\n\nA common practice when working on a Python project is to install its\ndependencies in a virtual environment and develop the project inside that\nenvironment. To support this, YCM needs to know the interpreter path of the\nvirtual environment. You can specify it by creating a `.ycm_extra_conf.py` file\nat the root of your project with the following contents:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'interpreter_path': '/path/to/virtual/environment/python'\n  }\n```\n\nHere, `/path/to/virtual/environment/python` is the path to the Python used\nby the virtual environment you are working in. Typically, the executable can be\nfound in the `Scripts` folder of the virtual environment directory on Windows\nand in the `bin` folder on other platforms.\n\nIf you don't like having to create a `.ycm_extra_conf.py` file at the root of\nyour project and would prefer to specify the interpreter path with a Vim option,\nread the [Configuring through Vim options](#configuring-through-vim-options)\nsection.\n\n#### Working with third-party packages\n\nAnother common practice is to put the dependencies directly into the project and\nadd their paths to `sys.path` at runtime in order to import them. YCM needs to\nbe told about this path manipulation to support those dependencies. This can be\ndone by creating a `.ycm_extra_conf.py` file at the root of the project. This\nfile must define a `Settings( **kwargs )` function returning a dictionary with\nthe list of paths to prepend to `sys.path` under the `sys_path` key. For\ninstance, the following `.ycm_extra_conf.py` adds the paths\n`/path/to/some/third_party/package` and `/path/to/another/third_party/package`\nat the start of `sys.path`:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'sys_path': [\n      '/path/to/some/third_party/package',\n      '/path/to/another/third_party/package'\n    ]\n  }\n```\n\nIf you would rather prepend paths to `sys.path` with a Vim option, read the\n[Configuring through Vim options](#configuring-through-vim-options) section.\n\nIf you need further control on how to add paths to `sys.path`, you should define\nthe `PythonSysPath( **kwargs )` function in the `.ycm_extra_conf.py` file. Its\nkeyword arguments are `sys_path` which contains the default `sys.path`, and\n`interpreter_path` which is the path to the Python interpreter. Here's a trivial\nexample that inserts the `/path/to/third_party/package` path at the second\nposition of `sys.path`:\n\n```python\ndef PythonSysPath( **kwargs ):\n  sys_path = kwargs[ 'sys_path' ]\n  sys_path.insert( 1, '/path/to/third_party/package' )\n  return sys_path\n```\n\nA more advanced example can be found in [YCM's own\n`.ycm_extra_conf.py`][ycm_flags_example].\n\n#### Configuring through Vim options\n\nYou may find it inconvenient to have to create a `.ycm_extra_conf.py` file at the\nroot of each one of your projects in order to set the path to the Python\ninterpreter and/or add paths to `sys.path` and would prefer to be able to\nconfigure those through Vim options. Don't worry, this is possible by using the\n[`g:ycm_extra_conf_vim_data`](#the-gycm_extra_conf_vim_data-option) option and\ncreating a global extra configuration file. Let's take an example. Suppose that\nyou want to set the interpreter path with the `g:ycm_python_interpreter_path`\noption and prepend paths to `sys.path` with the `g:ycm_python_sys_path` option.\nSuppose also that you want to name the global extra configuration file\n`global_extra_conf.py` and that you want to put it in your HOME folder. You\nshould then add the following lines to your vimrc:\n\n```viml\nlet g:ycm_python_interpreter_path = ''\nlet g:ycm_python_sys_path = []\nlet g:ycm_extra_conf_vim_data = [\n  \\  'g:ycm_python_interpreter_path',\n  \\  'g:ycm_python_sys_path'\n  \\]\nlet g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'\n```\n\nThen, create the `~/global_extra_conf.py` file with the following contents:\n\n```python\ndef Settings( **kwargs ):\n  client_data = kwargs[ 'client_data' ]\n  return {\n    'interpreter_path': client_data[ 'g:ycm_python_interpreter_path' ],\n    'sys_path': client_data[ 'g:ycm_python_sys_path' ]\n  }\n```\n\nThat's it. You are done. Note that you don't need to restart the server when\nsetting one of the options. YCM will automatically pick the new values.\n\n### Rust Semantic Completion\n\nYCM uses [rust-analyzer][] for Rust semantic completion.\n\nNOTE: Previously, YCM used [rls][] for rust completion. This is no longer\nsupported, as the Rust community has decided on [rust-analyzer][] as the future\nof Rust tooling.\n\nCompletions and GoTo commands within the current crate and its dependencies\nshould work out of the box with no additional configuration (provided that you\nbuilt YCM with the `--rust-completer` flag; see the [*Installation*\nsection](#installation) for details). The install script takes care of\ninstalling [the Rust source code][rust-src], so no configuration is necessary.\n\n`rust-analyzer` supports a myriad of options. These are configured using [LSP\nconfiguration](#lsp-configuration), and are [documented here](https://rust-analyzer.github.io/manual.html#configuration]).\n\n### Go Semantic Completion\n\nCompletions and GoTo commands should work out of the box (provided that you\nbuilt YCM with the `--go-completer` flag; see the [*Installation*\nsection](#installation) for details). The server only works for projects with\nthe \"canonical\" layout.\n\n`gopls` also has a load of [documented options](https://github.com/golang/tools/blob/master/gopls/doc/settings.md).\n\nYou can set these in your `.ycm_extra_conf.py`. For example, to set the build tags:\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'go':\n    return {\n       'ls': {\n         'build.buildFlags': [ '-tags=debug' ] }\n       }\n    }\n```\n\n### JavaScript and TypeScript Semantic Completion\n\n**NOTE:** YCM originally used the [Tern][] engine for JavaScript but due to\n[Tern][] not being maintained anymore by its main author and the [TSServer][]\nengine offering more features, YCM is moving to [TSServer][]. This won't affect\nyou if you were already using [Tern][] but you are encouraged to do the switch\nby deleting the `third_party/ycmd/third_party/tern_runtime/node_modules`\ndirectory in YCM folder. If you are a new user but still want to use [Tern][],\nyou should pass the `--js-completer` option to the `install.py` script during\ninstallation. Further instructions on how to set up YCM with [Tern][] are\navailable on [the wiki][tern-instructions].\n\nAll JavaScript and TypeScript features are provided by the [TSServer][] engine,\nwhich is included in the TypeScript SDK. To enable these features, install\n[Node.js 18+ and npm][npm-install] and call the `install.py` script with the\n`--ts-completer` flag.\n\n[TSServer][] relies on [the `jsconfig.json` file][jsconfig.json] for JavaScript\nand [the `tsconfig.json` file][tsconfig.json] for TypeScript to analyze your\nproject. Ensure the file exists at the root of your project.\n\nTo get diagnostics in JavaScript, set the `checkJs` option to `true` in your\n`jsconfig.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"checkJs\": true\n    }\n}\n```\n\n### Semantic Completion for Other Languages\n\nC-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are\nsupported natively by YouCompleteMe using the [Clang][], [OmniSharp-Roslyn][],\n[Gopls][], [jdt.ls][], [Jedi][], [rust-analyzer][], and [TSServer][] engines,\nrespectively. Check the [installation](#installation) section for instructions\nto enable these features if desired.\n\n#### Plugging an arbitrary LSP server\n\nSimilar to other LSP clients, YCM can use an arbitrary LSP server with the help\nof [`g:ycm_language_server`](#the-gycm_language_server-option) option. An\nexample of a value of this option would be:\n\n```viml\nlet g:ycm_language_server = \n  \\ [ \n  \\   {\n  \\     'name': 'yaml',\n  \\     'cmdline': [ '/path/to/yaml/server/yaml-language-server', '--stdio' ],\n  \\     'filetypes': [ 'yaml' ]\n  \\   },\n  \\   {\n  \\     'name': 'csharp',\n  \\     'cmdline': [ 'OmniSharp', '-lsp' ],\n  \\     'filetypes': [ 'csharp' ],\n  \\     'project_root_files': [ '*.csproj', '*.sln' ]\n  \\   },\n  \\   {\n  \\     'name': 'godot',\n  \\     'filetypes': [ 'gdscript' ],\n  \\     'port': 6008,\n  \\     'project_root_files': [ 'project.godot' ]\n  \\    }\n  \\ ]\n```\n\nEach dictionary contains the following keys:\n\n* `name` (string, mandatory): When [configuring a LSP\n  server](#lsp-configuration) the value of the `name` key will be used as the\n  `kwargs[ 'language' ]`. Can be anything you like.\n* `filetypes` (list of string, mandatory): List of Vim filetypes this server\n  should be used for.\n* `project_root_files` (list of string, optional): List of filenames to search\n  for when trying to determine the project's root. Uses python's pathlib for\n  glob matching.\n* `cmdline` (list of strings, optional): If supplied, the server is started with\n  this command line (each list element is a command line word). Typically, the\n  server should be started with STDIO communication. If not supplied, `port`\n  must be supplied.\n* `port` (number, optional): If supplied, ycmd will connect to the server at\n  `localhost:\u003cport\u003e` using TCP (remote servers are not supported).\n* `capabilities` (dict, optional): If supplied, this is a dictionary that is\n  merged with the LSP client capabilities reported to the language server. This\n  can be used to enable or disable certain features, such as the support for\n  configuration sections (`workspace/configuration`).\n\nSee [the LSP Examples](https://github.com/ycm-core/lsp-examples) project for more\nexamples of configuring the likes of PHP, Ruby, Kotlin, and D.\n\n#### LSP Configuration\n\nMany LSP servers allow some level of user configuration. YCM enables this with\nthe help of `.ycm_extra_conf.py` files. Here's an example of jdt.ls user\nexamples of configuring the likes of PHP, Ruby, Kotlin, D, and many, many more.\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'java':\n    return {\n      'ls': {\n        'java.format.onType.enabled': True\n      }\n    }\n```\n\nThe `ls` key tells YCM that the dictionary should be passed to the LSP server.\nFor each of the LSP server's configuration, you should look up the respective\nserver's documentation.\n\nSome servers request settings from arbitrary 'sections' of configuration. There\nis no concept of configuration sections in Vim, so you can specify an additional\n`config_sections` dictionary which maps section to a dictionary of config\nrequired by the server. For example:\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'java':\n    return {\n      'ls': {\n        'java.format.onType.enabled': True\n      },\n      'config_sections': {\n        'some section': {\n          'some option': 'some value'\n        }\n    }\n```\n\nThe sections and options/values are completely server-specific and rarely well\ndocumented.\n\n#### Using `omnifunc` for semantic completion\n\nYCM will use your `omnifunc` (see `:h omnifunc` in Vim) as a source for semantic\ncompletions if it does not have a native semantic completion engine for your\nfile's filetype. Vim comes with rudimentary omnifuncs for various languages like\nRuby, PHP, etc. It depends on the language.\n\nYou can get a stellar omnifunc for Ruby with [Eclim][]. Just make sure you have\nthe _latest_ Eclim installed and configured (this means Eclim `\u003e= 2.2.*` and\nEclipse `\u003e= 4.2.*`).\n\nAfter installing Eclim remember to create a new Eclipse project within your\napplication by typing `:ProjectCreate \u003cpath-to-your-project\u003e -n ruby` inside Vim\nand don't forget to have `let g:EclimCompletionMethod = 'omnifunc'` in your\nvimrc. This will make YCM and Eclim play nice; YCM will use Eclim's omnifuncs as\nthe data source for semantic completions and provide the auto-triggering and\nsubsequence-based matching (and other YCM features) on top of it.\n\n### Writing New Semantic Completers\n\nYou have two options here: writing an `omnifunc` for Vim's omnicomplete system\nthat YCM will then use through its omni-completer, or a custom completer for YCM\nusing the [Completer API][completer-api].\n\nHere are the differences between the two approaches:\n\n- You have to use VimScript to write the omnifunc, but get to use Python to\n  write for the Completer API; this by itself should make you want to use the\n  API.\n- The Completer API is a _much_ more powerful way to integrate with YCM and it\n  provides a wider set of features. For instance, you can make your Completer\n  query your semantic back-end in an asynchronous fashion, thus not blocking\n  Vim's GUI thread while your completion system is processing stuff. This is\n  impossible with VimScript. All of YCM's completers use the Completer API.\n- Performance with the Completer API is better since Python executes faster than\n  VimScript.\n\nIf you want to use the `omnifunc` system, see the relevant Vim docs with `:h\ncomplete-functions`. For the Completer API, see [the API docs][completer-api].\n\nIf you want to upstream your completer into YCM's source, you should use the\nCompleter API.\n\n### Diagnostic Display\n\nYCM will display diagnostic notifications for the C-family, C#, Go, Java,\nJavaScript, Rust, and TypeScript languages. Since YCM continuously recompiles\nyour file as you type, you'll get notified of errors and warnings in your file\nas fast as possible.\n\nHere are the various pieces of the diagnostic UI:\n\n- Icons show up in the Vim gutter on lines that have a diagnostic.\n- Regions of text related to diagnostics are highlighted (by default, a red\n  wavy underline in `gvim` and a red background in `vim`).\n- Moving the cursor to a line with a diagnostic echoes the diagnostic text.\n- Vim's location list is automatically populated with diagnostic data (off by\n  default, see options).\n\nThe new diagnostics (if any) will be displayed the next time you press any key\non the keyboard. So if you stop typing and just wait for the new diagnostics to\ncome in, that _will not work_. You need to press some key for the GUI to update.\n\nHaving to press a key to get the updates is unfortunate, but cannot be changed\ndue to the way Vim internals operate; there is no way that a background task can\nupdate Vim's GUI after it has finished running.  You _have to_ press a key. This\nwill make YCM check for any pending diagnostics updates.\n\nYou _can_ force a full, blocking compilation cycle with the\n`:YcmForceCompileAndDiagnostics` command (you may want to map that command to a\nkey; try putting `nnoremap \u003cF5\u003e :YcmForceCompileAndDiagnostics\u003cCR\u003e` in your\nvimrc). Calling this command will force YCM to immediately recompile your file\nand display any new diagnostics it encounters. Do note that recompilation with\nthis command may take a while and during this time the Vim GUI _will_ be\nblocked.\n\nYCM will display a short diagnostic message when you move your cursor to the\nline with the error. You can get a detailed diagnostic message with the\n`\u003cleader\u003ed` key mapping (can be changed in the options) YCM provides when your\ncursor is on the line with the diagnostic.\n\nYou can also see the full diagnostic message for all the diagnostics in the\ncurrent file in Vim's `locationlist`, which can be opened with the `:lopen` and\n`:lclose` commands (make sure you have set `let\ng:ycm_always_populate_location_list = 1` in your vimrc). A good way to toggle\nthe display of the `locationlist` with a single key mapping is provided by\nanother (very small) Vim plugin called [ListToggle][] (which also makes it\npossible to change the height of the `locationlist` window), also written by\nyours truly.\n\n#### Diagnostic Highlighting Groups\n\nYou can change the styling for the highlighting groups YCM uses. For the signs\nin the Vim gutter, the relevant groups are:\n\n- `YcmErrorSign`, which falls back to group `SyntasticErrorSign` and then\n  `error` if they exist\n- `YcmWarningSign`, which falls back to group `SyntasticWarningSign` and then\n  `todo` if they exist\n\nYou can also style the line that has the warning/error with these groups:\n\n- `YcmErrorLine`, which falls back to group `SyntasticErrorLine` if it exists\n- `YcmWarningLine`, which falls back to group `SyntasticWarningLine` if it\n  exists\n\nFinally, you can also style the popup for the detailed diagnostics (it is shown\nif `g:ycm_show_detailed_diag_in_popup` is set) using the group `YcmErrorPopup`,\nwhich falls back to `ErrorMsg`.\n\nNote that the line highlighting groups only work when the\n[`g:ycm_enable_diagnostic_signs`](#the-gycm_enable_diagnostic_signs-option)\noption is set. If you want highlighted lines but no signs in the Vim gutter,\nset the `signcolumn` option to `no` in your vimrc:\n\n```viml\nset signcolumn=no\n```\n\nThe syntax groups used to highlight regions of text with errors/warnings:\n- `YcmErrorSection`, which falls back to group `SyntasticError` if it exists and\n  then `SpellBad`\n- `YcmWarningSection`, which falls back to group `SyntasticWarning` if it exists\n  and then `SpellCap`\n\nHere's how you'd change the style for a group:\n\n```viml\nhighlight YcmErrorLine guibg=#3f0000\n```\n\n### Symbol Search\n\n***This feature requires Vim and is not supported in Neovim***\n\nYCM provides a way to search for and jump to a symbol in the current project or\ndocument when using supported languages.\n\nYou can search for symbols in the current workspace when the `GoToSymbol`\nrequest is supported and the current document when `GoToDocumentOutline` is\nsupported.\n\nHere's a quick demo: \n\n[![asciicast](https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C.svg)](https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C)\n\nAs you can see, you can type and YCM filters down the list as you type. The\ncurrent set of matches are displayed in a popup window in the centre of the\nscreen and you can select an entry with the keyboard, to jump to that position.\nAny matches are then added to the quickfix list.\n\nTo enable:\n\n* `nmap \u003csomething\u003e \u003cPlug\u003e(YCMFindSymbolInWorkspace)`\n* `nmap \u003csomething\u003e \u003cPlug\u003e(YCMFindSymbolInDocument)`\n\ne.g.\n\n* `nmap \u003cleader\u003eyfw \u003cPlug\u003e(YCMFindSymbolInWorkspace)`\n* `nmap \u003cleader\u003eyfd \u003cPlug\u003e(YCMFindSymbolInDocument)`\n\nWhen searching, YCM opens a prompt buffer at the top of the screen for the\ninput and puts you in insert mode. This means that you can hit `\u003cEsc\u003e` to go\ninto normal mode and use any other input commands that are supported in prompt\nbuffers. As you type characters, the search is updated.\n\nInitially, results are queried from all open filetypes. You can hit `\u003cC-f\u003e` to\nswitch to just the current filetype while the popup is open.\n\nWhile the popup is open, the following keys are intercepted:\n\n* `\u003cC-j\u003e`, `\u003cDown\u003e`, `\u003cC-n\u003e`, `\u003cTab\u003e` - select the next item\n* `\u003cC-k\u003e`, `\u003cUp\u003e`, `\u003cC-p\u003e`, `\u003cS-Tab\u003e` - select the previous item\n* `\u003cPageUp\u003e`, `\u003ckPageUp\u003e` - jump up one screenful of items \n* `\u003cPageDown\u003e`, `\u003ckPageDown\u003e` - jump down one screenful of items\n* `\u003cHome\u003e`, `\u003ckHome\u003e` - jump to first item\n* `\u003cEnd\u003e`, `\u003ckEnd\u003e` - jump to last item\n* `\u003cCR\u003e` - jump to the selected item\n* `\u003cC-c\u003e` cancel/dismiss the popup\n* `\u003cC-f\u003e` - toggle results from all file types or just the current filetype\n\nThe search is also cancelled if you leave the prompt buffer window at any time,\nso you can use window commands `\u003cC-w\u003e...` for example.\n\n#### Closing the popup\n\n***NOTE***: Pressing `\u003cEsc\u003e` does not close the popup - you must use `Ctrl-c`\nfor that, or use a window command (e.g. `\u003cCtrl-w\u003ej`) or the mouse to leave the\nprompt buffer window.\n\n### Type/Call Hierarchy\n\n***This feature requires Vim and is not supported in Neovim***\n\n**NOTE**: This feature is highly experimental and offered in the hope that it is\nuseful. Please help us by reporting issues and offering feedback.\n\nYCM provides a way to view and navigate hierarchies. The following hierarchies\nare supported:\n\n* Type hierachy `\u003cPlug\u003e(YCMTypeHierarchy)`: Display subtypes and supertypes\n  of the symbol under cursor. Expand down to subtypes and up to supertypes.\n* Call hierarchy `\u003cPlug\u003e(YCMCallHierarchy)`: Display callees and callers of\n  the symbol under cursor. Expand down to callers and up to callees.\n\nTake a look at this [![asciicast](https://asciinema.org/a/659925.svg)](https://asciinema.org/a/659925)\nfor brief demo.\n\nHierarchy UI can be initiated by mapping something to the indicated plug\nmappings, for example:\n\n```viml\nnmap \u003cleader\u003eyth \u003cPlug\u003e(YCMTypeHierarchy)\nnmap \u003cleader\u003eych \u003cPlug\u003e(YCMCallHierarchy)\n```\n\nThis opens a \"modal\" popup showing the current element in the hierarchy tree.\nThe current tree root is aligned to the left and child and parent nodes are\nexpanded to the right. Expand the tree \"down\" with `\u003cTab\u003e and \"up\" with\n`\u003cS-Tab\u003e`.\n\nThe \"root\" of the tree can be re-focused to the selected item with\n`\u003cS-Tab\u003e` and further `\u003cS-Tab\u003e` will show the parents of the selected item. This\ncan take a little getting used to, but it's particularly important with multiple\ninheritance where a \"child\" of the current root may actually have other,\ninvisible, parent links. `\u003cS-Tab\u003e` on that row will show these by setting the\ndisplay root to the selected item.\n\nWhen the hierarchy is displayed, the following keys are intercepted:\n\n* `\u003cTab\u003e`: Drill into the hierarchy at the selected item: expand and show\n  children of the selected item.\n* `\u003cS-Tab\u003e`: Show parents of the selected item. When applied to sub-types, this\n  will re-root the tree at that type, so that all parent types (are displayed).\n  Similar for callers.\n* `\u003cCR\u003e`: Jump to the symbol currently selected.\n* `\u003cDown\u003e`, `\u003cC-n\u003e`, `\u003cC-j\u003e`, `j`: Select the next item\n* `\u003cUp\u003e`, `\u003cC-p\u003e`, `\u003cC-k\u003e`, `k`; Select the previous item\n* Any other key: closes the popup without jumping to any location\n\n**Note:** you might think the call hierarchy tree is inverted, but we think\nthis way round is more intuitive because this is the typical way that call\nstacks are displayed (with the current function at the top, and its callers\nbelow). \n\nCommands\n--------\n\n### The `:YcmRestartServer` command\n\nIf the [ycmd completion server][ycmd] suddenly stops for some reason, you can\nrestart it with this command.\n\n### The `:YcmForceCompileAndDiagnostics` command\n\nCalling this command will force YCM to immediately recompile your file\nand display any new diagnostics it encounters. Do note that recompilation with\nthis command may take a while and during this time the Vim GUI _will_ be\nblocked.\n\nYou may want to map this command to a key; try putting `nnoremap \u003cF5\u003e\n:YcmForceCompileAndDiagnostics\u003cCR\u003e` in your vimrc.\n\n### The `:YcmDiags` command\n\nCalling this command will fill Vim's `locationlist` with errors or warnings if\nany were detected in your file and then open it. If a given error or warning can\nbe fixed by a call to `:YcmCompleter FixIt`, then ` (FixIt available)` is\nappended to the error or warning text. See the `FixIt` completer subcommand for\nmore information.\n\n**NOTE:** The absence of ` (FixIt available)` does not strictly imply a fix-it\nis not available as not all completers are able to provide this indication. For\nexample, the c-sharp completer provides many fix-its but does not add this\nadditional indication.\n\nThe `g:ycm_open_loclist_on_ycm_diags` option can be used to prevent the location\nlist from opening, but still have it filled with new diagnostic data. See the\n_Options_ section for details.\n\n### The `:YcmShowDetailedDiagnostic` command\n\nThis command shows the full diagnostic text when the user's cursor is on the\nline with the diagnostic.\n\nAn options argument can be passed. If the argument is `popup` the diagnostic\ntext will be displayed in a popup at the cursor position.\n\nIf you prefer the detailed diagnostic to always be shown in a popup, then\n`let g:ycm_show_detailed_diag_in_popup=1`.\n\n### The `:YcmDebugInfo` command\n\nThis will print out various debug information for the current file. Useful to\nsee what compile commands will be used for the file if you're using the semantic\ncompletion engine.\n\n### The `:YcmToggleLogs` command\n\nThis command presents the list of logfiles created by YCM, the [ycmd\nserver][ycmd], and the semantic engine server for the current filetype, if any.\nOne of these logfiles can be opened in the editor (or closed if already open) by\nentering the corresponding number or by clicking on it with the mouse.\nAdditionally, this command can take the logfile names as arguments. Use the\n`\u003cTAB\u003e` key (or any other key defined by the `wildchar` option) to complete the\narguments or to cycle through them (depending on the value of the `wildmode`\noption). Each logfile given as an argument is directly opened (or closed if\nalready open) in the editor. Only for debugging purposes.\n\n### The `:YcmCompleter` command\n\nThis command gives access to a number of additional [IDE-like\nfeatures](#quick-feature-summary) in YCM, for things like semantic GoTo, type\ninformation, FixIt, and refactoring.\n\nThis command accepts a range that can either be specified through a selection in\none of Vim's visual modes (see `:h visual-use`) or on the command line. For\ninstance, `:2,5YcmCompleter` will apply the command from line 2 to line 5. This\nis useful for [the `Format` subcommand](#the-format-subcommand).\n\nCall `YcmCompleter` without further arguments for a list of the commands you can\ncall for the current completer.\n\nSee the [file type feature summary](#quick-feature-summary) for an overview of\nthe features available for each file type. See the _YcmCompleter subcommands_\nsection for more information on the available subcommands and their usage.\n\nSome commands, like `Format` accept a range, like `:%YcmCompleter Format`.\n\nSome commands like `GetDoc` and the various `GoTo` commands respect modifiers,\nlike `:rightbelow YcmCompleter GetDoc`, `:vertical YcmCompleter GoTo`.\n\nYcmCompleter Subcommands\n------------------------\n\n**NOTE:** See the docs for the `YcmCompleter` command before tackling this\nsection.\n\nThe invoked subcommand is automatically routed to the currently active semantic\ncompleter, so `:YcmCompleter GoToDefinition` will invoke the `GoToDefinition`\nsubcommand on the Python semantic completer if the currently active file is a\nPython one and on the Clang completer if the currently active file is a C-family\nlanguage one.\n\nYou may also want to map the subcommands to something less verbose; for\ninstance, `nnoremap \u003cleader\u003ejd :YcmCompleter GoTo\u003cCR\u003e`\nmaps the `\u003cleader\u003ejd` sequence to the longer subcommand invocation.\n\n### GoTo Commands\n\nThese commands are useful for jumping around and exploring code. When moving\nthe cursor, the subcommands add entries to Vim's `jumplist` so you can use\n`CTRL-O` to jump back to where you were before invoking the command (and\n`CTRL-I` to jump forward; see `:h jumplist` for details). If there is more\nthan one destination, the quickfix list (see `:h quickfix`) is populated with\nthe available locations and opened to the full width at the bottom of the screen.\nYou can change this behavior by using [the `YcmQuickFixOpened`\nautocommand](#the-ycmquickfixopened-autocommand).\n\n#### The `GoToInclude` subcommand\n\nLooks up the current line for a header and jumps to it.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GoToAlternateFile` subcommand\n\nJump to the associated file, as defined by the language server. Typically this\nwill jump you to the associated header file for a C or C++ translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda` (clangd only)\n\n#### The `GoToDeclaration` subcommand\n\nLooks up the symbol under the cursor and jumps to its declaration.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoToDefinition` subcommand\n\nLooks up the symbol under the cursor and jumps to its definition.\n\n**NOTE:** For C-family languages **this only works in certain situations**,\nnamely when the definition of the symbol is in the current translation unit. A\ntranslation unit consists of the file you are editing and all the files you are\nincluding with `#include` directives (directly or indirectly) in that file.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoTo` subcommand\n\nThis command tries to perform the \"most sensible\" GoTo operation it can.\nCurrently, this means that it tries to look up the symbol under the cursor and\njumps to its definition if possible; if the definition is not accessible from\nthe current translation unit, jumps to the symbol's declaration. For\nC-family languages, it first tries to look up the current line for a header and\njump to it. For C#, implementations are also considered and preferred.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoToImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GoTo` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take time to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect jumps. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GoToSymbol \u003csymbol query\u003e` subcommand\n\nFinds the definition of all symbols matching a specified string. Note that this\ndoes not use any sort of smart/fuzzy matching. However, an [interactive symbol\nsearch](#symbol-search) is also available.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, java, javascript, python, typescript`\n\n#### The `GoToReferences` subcommand\n\nThis command attempts to find all of the references within the project to the\nidentifier under the cursor and populates the quickfix list with those\nlocations.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, python, typescript, rust`\n\n#### The `GoToImplementation` subcommand\n\nLooks up the symbol under the cursor and jumps to its implementation (i.e.\nnon-interface). If there are multiple implementations, instead provides a list\nof implementations to choose from.\n\nSupported in filetypes: `cs, go, java, rust, typescript, javascript`\n\n#### The `GoToImplementationElseDeclaration` subcommand\n\nLooks up the symbol under the cursor and jumps to its implementation if one,\nelse jump to its declaration. If there are multiple implementations, instead\nprovides a list of implementations to choose from.\n\nSupported in filetypes: `cs`\n\n#### The `GoToType` subcommand\n\nLooks up the symbol under the cursor and jumps to the definition of its type\ne.g. if the symbol is an object, go to the definition of its class.\n\nSupported in filetypes: `go, java, javascript, typescript`\n\n#### The `GoToDocumentOutline` subcommand\n\nProvides a list of symbols in the current document, in the quickfix list. See also\n[interactive symbol search](#symbol-search).\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, go, java, rust`\n\n#### The `GoToCallers` and `GoToCallees` subcommands\n\nNote: A much more powerful call and type hierarchy can be viewd interactively.\nSee [interactive type and call hierarchy](#interactive-type-and-call-hierarchy).\n\nPopulate the quickfix list with the callers, or callees respectively, of the\nfunction associated with the current cursor position. The semantics of this\ndiffer depending on the filetype and language server.\n\nOnly supported for LSP servers that provide the `callHierarchyProvider`\ncapability.\n\n### Semantic Information Commands\n\nThese commands are useful for finding static information about the code, such\nas the types of variables, viewing declarations, and documentation strings.\n\n#### The `GetType` subcommand\n\nEchos the type of the variable or method under the cursor, and where it differs,\nthe derived type.\n\nFor example:\n\n```c++\n    std::string s;\n```\n\nInvoking this command on `s` returns `std::string =\u003e std::basic_string\u003cchar\u003e`\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript,\ngo, python, typescript, rust`\n\n#### The `GetTypeImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GetType` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take time to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect type. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GetParent` subcommand\n\nEchos the semantic parent of the point under the cursor.\n\nThe semantic parent is the item that semantically contains the given position.\n\nFor example:\n\n```c++\nclass C {\n    void f();\n};\n\nvoid C::f() {\n\n}\n```\n\nIn the out-of-line definition of `C::f`, the semantic parent is the class `C`,\nof which this function is a member.\n\nIn the example above, both declarations of `C::f` have `C` as their semantic\ncontext, while the lexical context of the first `C::f` is `C` and the lexical\ncontext of the second `C::f` is the translation unit.\n\nFor global declarations, the semantic parent is the translation unit.\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GetDoc` subcommand\n\nDisplays the preview window populated with quick info about the identifier\nunder the cursor. Depending on the file type, this includes things like:\n\n* The type or declaration of identifier,\n* Doxygen/javadoc comments,\n* Python docstrings,\n* etc.\n\nThe documentation is opened in the preview window, and options like\n`previewheight` are respected. If you would like to customise the height and\nposition of this window, we suggest a custom command that:\n\n* Sets `previewheight` temporarily\n* Runs the `GetDoc` command with supplied modifiers\n* Restores `previewheight`.\n\nFor example:\n\n```viml\ncommand -count ShowDocWithSize\n  \\ let g:ph=\u0026previewheight \n  \\ \u003cbar\u003e set previewheight=\u003ccount\u003e\n  \\ \u003cbar\u003e \u003cmods\u003e YcmCompleter GetDoc\n  \\ \u003cbar\u003e let \u0026previewheight=g:ph\n```\n\nYou can then use something like `:botright vertical 80ShowDocWithSize`. Here's an\nexample of that: https://asciinema.org/a/hE6Pi1gU6omBShwFna8iwGEe9\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, typescript, rust`\n\n#### The `GetDocImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GetDoc` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take long to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect docs. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n### Refactoring Commands\n\nThese commands make changes to your source code in order to perform refactoring\nor code correction. YouCompleteMe does not perform any action which cannot be\nundone, and never saves or writes files to the disk.\n\n#### The `FixIt` subcommand\n\nWhere available, attempts to make changes to the buffer to correct diagnostics,\nor perform refactoring, on the current line or selection. Where multiple\nsuggestions are available (such as when there are multiple ways to resolve a\ngiven warning, or where multiple diagnostics are reported for the current line,\nor multiple refactoring tweaks are available), the options are presented and\none can be selected.\n\nCompleters that provide diagnostics may also provide trivial modifications to\nthe source in order to correct the diagnostic. Examples include syntax errors\nsuch as missing trailing semi-colons, spurious characters, or other errors which\nthe semantic engine can deterministically suggest corrections. A small demo\npresenting how diagnostics can be fixed with clangd:\n\n![YcmCompleter-FixIt-OnDiagnostic](https://user-images.githubusercontent.com/17928698/206855014-9131a49b-87e8-4ed4-8d91-f2fe7808a0b9.gif)\n\nCompleters (LSPs) may also provide refactoring tweaks, which may be available\neven when no diagnostic is presented for the current line. These include\nfunction extraction, variable extraction, `switch` population, constructor\ngeneration, ... The tweaks work for a selection as well. Consult your LSP for\navailable refactorings. A demonstration of refactoring capabilities with clangd:\n\n![YouCompleter-FixIt-Refactoring](https://user-images.githubusercontent.com/17928698/206855713-3588c8de-d0f5-4725-b65e-bc51110252cc.gif)\n\nIf no fix-it is available for the current line, or there is no diagnostic on the\ncurrent line, this command has no effect on the current buffer. If any\nmodifications are made, the number of changes made to the buffer is echo'd and\nthe user may use the editor's undo command to revert.\n\nWhen a diagnostic is available, and `g:ycm_echo_current_diagnostic` is enabled,\nthen the text ` (FixIt)` is appended to the echo'd diagnostic when the\ncompleter is able to add this indication. The text ` (FixIt available)` is\nalso appended to the diagnostic text in the output of the `:YcmDiags` command\nfor any diagnostics with available fix-its (where the completer can provide this\nindication).\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\nrust, typescript`\n\n#### The `RefactorRename \u003cnew name\u003e` subcommand\n\nIn supported file types, this command attempts to perform a semantic rename of\nthe identifier under the cursor. This includes renaming declarations,\ndefinitions, and usages of the identifier, or any other language-appropriate\naction. The specific behavior is defined by the semantic engine in use.\n\nSimilar to `FixIt`, this command applies automatic modifications to your source\nfiles. Rename operations may involve changes to multiple files, which may or may\nnot be open in Vim buffers at the time. YouCompleteMe handles all of this for\nyou. The behavior is described in [the following section](#multi-file-refactor).\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, python, typescript, rust, cs`\n\n#### Python refactorings\n\nThe following additional commands are supported for Python:\n\n* `RefactorInline`\n* `RefactorExtractVariable`\n* `RefactorExtractFunction`\n\nSee the [jedi docs][jedi-refactor-doc] for what they do.\n\nSupported in filetypes: `python`\n\n#### Multi-file Refactor\n\nWhen a Refactor or FixIt command touches multiple files, YouCompleteMe attempts\nto apply those modifications to any existing open, visible buffer in the current\ntab. If no such buffer can be found, YouCompleteMe opens the file in a new\nsmall horizontal split at the top of the current window, applies the change,\nand then *hides* the window. **NOTE:** The buffer remains open, and must be\nmanually saved. A confirmation dialog is opened prior to doing this to remind\nyou that this is about to happen.\n\nOnce the modifications have been made, the quickfix list (see `:help quickfix`)\nis populated with the locations of all modifications. This can be used to review\nall automatic changes made by using `:copen`. Typically, use the `CTRL-W\n\u003center\u003e` combination to open the selected file in a new split. It is possible to\ncustomize how the quickfix window is opened by using [the `YcmQuickFixOpened`\nautocommand](#the-ycmquickfixopened-autocommand).\n\nThe buffers are *not* saved automatically. That is, you must save the modified\nbuffers manually after reviewing the changes from the quickfix list. Changes\ncan be undone using Vim's powerful undo features (see `:help undo`). Note\nthat Vim's undo is per-buffer, so to undo all changes, the undo commands must\nbe applied in each modified buffer separately.\n\n**NOTE:** While applying modifications, Vim may find files that are already\nopen and have a swap file. The command is aborted if you select Abort or Quit in\nany such prompts. This leaves the Refactor operation partially complete and must\nbe manually corrected using Vim's undo features. The quickfix list is *not*\npopulated in this case. Inspect `:buffers` or equivalent (see `:help buffers`)\nto see the buffers that were opened by the command.\n\n#### The `Format` subcommand\n\nThis command formats the whole buffer or some part of it according to the value\nof the Vim options `shiftwidth` and `expandtab` (see `:h 'sw'` and `:h et`\nrespectively). To format a specific part of your document, you can either select\nit in one of Vim's visual modes (see `:h visual-use`) and run the command or\ndirectly enter the range on the command line, e.g. `:2,5YcmCompleter Format` to\nformat it from line 2 to line 5.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, go, typescript, rust, cs`\n\n#### The `OrganizeImports` subcommand\n\nThis command removes unused imports and sorts imports in the current file. It\ncan also group imports from the same module in TypeScript and resolve imports\nin Java.\n\nSupported in filetypes: `java, javascript, typescript`\n\n### Miscellaneous Commands\n\nThese commands are for general administration, rather than IDE-like features.\nThey cover things like the semantic engine server instance and compilation\nflags.\n\n#### The `ExecuteCommand \u003cargs\u003e` subcommand\n\nSome LSP completers (currently only Java completers) support executing\nserver-specific commands. Consult the [jdt.ls][] documentation to find out\nwhat commands are supported and which arguments are expected.\n\nThe support for `ExecuteCommand` was implemented to support plugins like\n[Vimspector][] to debug java, but isn't limited to that specific use case.\n\n#### The `RestartServer` subcommand\n\nRestarts the downstream semantic engine server for those semantic engines that\nwork as separate servers that YCM talks to.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript, rust, typescript`\n\n#### The `ReloadSolution` subcommand\n\nInstruct the Omnisharp-Roslyn server to clear its cache and reload all files\nfrom the disk.  This is useful when files are added, removed, or renamed in the\nsolution, files are changed outside of Vim, or whenever Omnisharp-Roslyn cache\nis out-of-sync.\n\nSupported in filetypes: `cs`\n\nFunctions\n--------\n\n### The `youcompleteme#GetErrorCount` function\n\nGet the number of YCM Diagnostic errors. If no errors are present, this function\nreturns 0.\n\nFor example:\n\n```viml\n  call youcompleteme#GetErrorCount()\n```\n\nBoth this function and `youcompleteme#GetWarningCount` can be useful when\nintegrating YCM with other Vim plugins. For example, a [lightline][] user could\nadd a diagnostics section to their statusline which would display the number of\nerrors and warnings.\n\n### The `youcompleteme#GetWarningCount` function\n\nGet the number of YCM Diagnostic warnings. If no warnings are present, this\nfunction returns 0.\n\nFor example:\n\n```viml\n  call youcompleteme#GetWarningCount()\n```\n\n### The `youcompleteme#GetCommandResponse( ... )` function\n\nRun a [completer subcommand](#ycmcompleter-subcommands) and return the result as\na string. This can be useful for example to display the `GetDoc` output in a\npopup window, e.g.:\n\n```viml\nlet s:ycm_hover_popup = -1\nfunction s:Hover()\n  let response = youcompleteme#GetCommandResponse( 'GetDoc' )\n  if response == ''\n    return\n  endif\n\n  call popup_hide( s:ycm_hover_popup )\n  let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )\nendfunction\n\n\" CursorHold triggers in normal mode after a delay\nautocmd CursorHold * call s:Hover()\n\" Or, if you prefer, a mapping:\nnnoremap \u003csilent\u003e \u003cleader\u003eD :call \u003cSID\u003eHover()\u003cCR\u003e\n```\n\n**NOTE**: This is only an example, for real hover support, see\n[`g:ycm_auto_hover`](#the-gycm_auto_hover-option).\n\nIf the completer subcommand result is not a string (for example, it's a FixIt or\na Location), or if the completer subcommand raises an error, an empty string is\nreturned, so that calling code does not have to check for complex error\nconditions.\n\nThe arguments to the function are the same as the arguments to the\n`:YcmCompleter` ex command, e.g. the name of the subcommand, followed by any\nadditional subcommand arguments. As with the `YcmCompleter` command, if the\nfirst argument is `ft=\u003cfiletype\u003e` the request is targeted at the specified\nfiletype completer. This is an advanced usage and not necessary in most cases.\n\nNOTE: The request is run synchronously and blocks Vim until the response is\nreceived, so we do not recommend running this as part of an autocommand that\ntriggers frequently.\n\n### The `youcompleteme#GetCommandResponseAsync( callback, ... )` function\n\nThis works exactly like `youcompleteme#GetCommandResponse`, except that instead\nof returning the result, you supply a `callback` argument. This argument must be\na `FuncRef` to a function taking a single argument `response`. This callback\nwill be called with the command response at some point later, or immediately.\n\nAs with `youcompleteme#GetCommandResponse()`, this function will call the\ncallback with `''` (an empty string) if the request is not sent, or if there was\nsome sort of error.\n\nHere's an example that's similar to the one above:\n\n```viml\n\nlet s:ycm_hover_popup = -1\nfunction! s:ShowDataPopup( response ) abort\n  if response == ''\n    return\n  endif\n\n  call popup_hide( s:ycm_hover_popup )\n  let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )\nendfunction\n\nfunction! s:GetData() abort\n  call youcompleteme#GetCommandResponseAsync(\n    \\ function( 's:ShowDataPopup' ),\n    \\ 'GetDoc' )\nendfunction\n\nautocommand CursorHold * call s:GetData()\n```\n\nAgain, see [`g:ycm_auto_hover`](#the-gycm_auto_hover-option) for proper hover\nsupport.\n\n**NOTE**: The callback may be called immediately, in the stack frame that called\nthis function.\n\n**NOTE**: Only one command request can be outstanding at once. Attempting to\nrequest a second response while the first is outstanding will result in the\nsecond callback being immediately called with `''`.\n\nAutocommands\n------------\n\n### The `YcmLocationOpened` autocommand\n\nThis `User` autocommand is fired when YCM opens the location list window in\nresponse to the `YcmDiags` command. By default, the location list window is\nopened to the bottom of the current window and its height is set to fit all\nentries. This behavior can be overridden by using the `YcmLocationOpened`\nautocommand which is triggered while the cursor is in the location list window.\nFor instance:\n\n```viml\nfunction! s:CustomizeYcmLocationWindow()\n  \" Move the window to the top of the screen.\n  wincmd K\n  \" Set the window height to 5.\n  5wincmd _\n  \" Switch back to the working window.\n  wincmd p\nendfunction\n\nautocmd User YcmLocationOpened call s:CustomizeYcmLocationWindow()\n```\n\n### The `YcmQuickFixOpened` autocommand\n\nThis `User` autocommand is fired when YCM opens the quickfix window in response\nto the `GoTo*` and `RefactorRename` subcommands. By default, the quickfix window\nis opened to full width at the bottom of the screen and its height is set to fit\nall entries. This behavior can be overridden by using the `YcmQuickFixOpened`\nautocommand which is triggered while the cursor is in the quickfix window. For\ninstance:\n\n```viml\nfunction! s:CustomizeYcmQuickFixWindow()\n  \" Move the window to the top of the screen.\n  wincmd K\n  \" Set the window height to 5.\n  5wincmd _\nendfunction\n\nautocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()\n```\n\nOptions\n-------\n\nAll options have reasonable defaults so if the plug-in works after installation\nyou don't need to change any options. These options can be configured in your\n[vimrc script][vimrc] by including a line like this:\n\n```viml\nlet g:ycm_min_num_of_chars_for_completion = 1\n```\n\nNote that after changing an option in your [vimrc script][vimrc] you have to\nrestart [ycmd][] with the `:YcmRestartServer` command for the changes to take\neffect.\n\n### The `g:ycm_min_num_of_chars_for_completion` option\n\nThis option controls the number of characters the user needs to type before\nidentifier-based completion suggestions are triggered. For example, if the\noption is set to `2`, then when the user types a second alphanumeric character\nafter a whitespace character, completion suggestions will be triggered. This\noption is NOT used for semantic completion.\n\nSetting this option to a high number like `99` effectively turns off the\nidentifier completion engine and just leaves the semantic engine.\n\nDefault: `2`\n\n```viml\nlet g:ycm_min_num_of_chars_for_completion = 2\n```\n\n### The `g:ycm_min_num_identifier_candidate_chars` option\n\nThis option controls the minimum number of characters that a completion\ncandidate coming from the identifier completer must have to be shown in the\npopup menu.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** This option only applies to the identifier completer; it has no effect\non the various semantic completers.\n\nDefault: `0`\n\n```viml\nlet g:ycm_min_num_identifier_candidate_chars = 0\n```\n\n### The `g:ycm_max_num_candidates` option\n\nThis option controls the maximum number of semantic completion suggestions shown\nin the completion menu. This only applies to suggestions from semantic\ncompletion engines; see [the `g:ycm_max_identifier_candidates`\noption](#the-gycm_max_num_identifier_candidates-option) to limit the number of\nsuggestions from the identifier-based engine.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** Setting this option to `0` or to a value greater than `100` is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: `50`\n\n```viml\nlet g:ycm_max_num_candidates = 50\n```\n\n### The `g:ycm_max_num_candidates_to_detail` option\n\nSome completion engines require completion candidates to be 'resolved' in order\nto get detailed info such as inline documentation, method signatures, etc.  This\ninformation is displayed by YCM in the preview window, or if `completeopt`\ncontains `popup`, in the info popup next to the completion menu.\n\nBy default, if the info popup is in use, and there are more than 10 candidates,\nYCM will defer resolving candidates until they are selected in the completion\nmenu.  Otherwise, YCM must resolve the details upfront, which can be costly.\n\nIf neither `popup` nor `preview` are in `completeopt`, YCM disables resolving\naltogether as the information would not be displayed.\n\nThis setting can be used to override these defaults and  controls the number of\ncompletion candidates that should be resolved upfront. Typically users do not\nneed to change this, as YCM will work out an appropriate value based on your\n`completeopt` and `g:ycm_add_preview_to_completeopt` settings. However, you may\noverride this calculation by setting this value to a number:\n\n* `-1` - Resolve all candidates upfront\n* `0` - Never resolve any candidates upfront.\n* `\u003e 0` - Resolve up to this many candidates upfront. If the number of\n  candidates is greater than this value, no candidates are resolved.\n\nIn the latter two cases, if `completeopt` contains `popup`, then candidates are\nresolved on demand asynchronously.\n\nDefault:\n\n* `0` if neither `popup` nor `preview` are in `completeopt`.\n* `10` if `popup` is in completeopt.\n* `-1` if `preview` is in completeopt.\n\nExample:\n\n```viml\nlet g:ycm_max_num_candidates_to_detail = 0\n```\n\n### The `g:ycm_max_num_identifier_candidates` option\n\nThis option controls the maximum number of completion suggestions from the\nidentifier-based engine shown in the completion menu.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** Setting this option to `0` or to a value greater than `100` is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: `10`\n\n```viml\nlet g:ycm_max_num_identifier_candidates = 10\n```\n\n### The `g:ycm_auto_trigger` option\n\nWhen set to `0`, this option turns off YCM's identifier completer (the\nas-you-type popup) _and_ the semantic triggers (the popup you'd get after typing\n`.` or `-\u003e` in say C++). You can still force semantic completion with the\n`\u003cC-Space\u003e` shortcut.\n\nIf you want to just turn off the identifier completer but keep the semantic\ntriggers, you should set `g:ycm_min_num_of_chars_for_completion` to a high\nnumber like `99`.\n\nWhen `g:ycm_auto_trigger` is `0`, YCM sets the `completefunc`, so that you can\nmanually trigger normal completion using `C-x C-u`.\n\nIf you want to map something else to trigger completion, such as `C-d`,\nthen you can map it to `\u003cplug\u003e(YCMComplete)`. For example:\n\n```viml\nlet g:ycm_auto_trigger = 0\nimap \u003cc-d\u003e \u003cplug\u003e(YCMComplete)\n```\n\nNOTE: It's not possible to map one of the keys in\n`g:ycm_key_list_select_completion` (or similar) to `\u003cplug\u003e(YCMComplete)`. In\npractice that means that you can't use `\u003cTab\u003e` for this.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_trigger = 1\n```\n\n### The `g:ycm_filetype_whitelist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should YCM be\nturned on. The option value should be a Vim dictionary with keys being filetype\nstrings (like `python`, `cpp`, etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nThe `*` key is special and matches all filetypes. By default, the whitelist\ncontains only this `*` key.\n\nYCM also has a `g:ycm_filetype_blacklist` option that lists filetypes for which\nYCM shouldn't be turned on. YCM will work only in filetypes that both the\nwhitelist and the blacklist allow (the blacklist \"allows\" a filetype by _not_\nhaving it as a key).\n\nFor example, let's assume you want YCM to work in files with the `cpp` filetype.\nThe filetype should then be present in the whitelist either directly (`cpp` key\nin the whitelist) or indirectly through the special `*` key. It should _not_ be\npresent in the blacklist.\n\nFiletypes that are blocked by either of the lists will be completely ignored\nby YCM, meaning that neither the identifier-based completion engine nor the\nsemantic engine will operate in them.\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `{'*': 1}`\n\n```viml\nlet g:ycm_filetype_whitelist = {'*': 1}\n```\n\n** Completion in buffers with no filetype **\n\nThere is one exception to the above rule. YCM supports completion in buffers\nwith no filetype set, but this must be _explicitly_ whitelisted. To identify\nbuffers with no filetype, we use the `ycm_nofiletype` pseudo-filetype. To enable\ncompletion in buffers with no filetype, set:\n\n```viml\nlet g:ycm_filetype_whitelist = {\n  \\ '*': 1,\n  \\ 'ycm_nofiletype': 1\n  \\ }\n```\n\n### The `g:ycm_filetype_blacklist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should YCM be\nturned off. The option value should be a Vim dictionary with keys being filetype\nstrings (like `python`, `cpp`, etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nSee the `g:ycm_filetype_whitelist` option for more details on how this works.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filetype_blacklist = {\n      \\ 'tagbar': 1,\n      \\ 'notes': 1,\n      \\ 'markdown': 1,\n      \\ 'netrw': 1,\n      \\ 'unite': 1,\n      \\ 'text': 1,\n      \\ 'vimwiki': 1,\n      \\ 'pandoc': 1,\n      \\ 'infolog': 1,\n      \\ 'leaderf': 1,\n      \\ 'mail': 1\n      \\}\n```\n\nIn addition, `ycm_nofiletype` (representing buffers with no filetype set)\nis blacklisted if `ycm_nofiletype` is not _explicitly_ whitelisted (using\n`g:ycm_filetype_whitelist`).\n\n### The `g:ycm_filetype_specific_completion_to_disable` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should the YCM\nsemantic completion engine be turned off. The option value should be a Vim\ndictionary with keys being filetype strings (like `python`, `cpp`, etc.) and\nvalues being unimportant (the dictionary is used like a hash set, meaning that\nonly the keys matter). The listed filetypes will be ignored by the YCM semantic\ncompletion engine, but the identifier-based completion engine will still trigger\nin files of those filetypes.\n\nNote that even if semantic completion is not turned off for a specific filetype,\nyou will not get semantic completion if the semantic engine does not support\nthat filetype.\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filetype_specific_completion_to_disable = {\n      \\ 'gitcommit': 1\n      \\}\n```\n\n### The `g:ycm_filepath_blacklist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should filepath\ncompletion be disabled. The option value should be a Vim dictionary with keys\nbeing filetype strings (like `python`, `cpp`, etc.) and values being unimportant\n(the dictionary is used like a hash set, meaning that only the keys matter).\n\nThe `*` key is special and matches all filetypes. Use this key if you want to\ncompletely disable filepath completion:\n\n```viml\nlet g:ycm_filepath_blacklist = {'*': 1}\n```\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filepath_blacklist = {\n      \\ 'html': 1,\n      \\ 'jsx': 1,\n      \\ 'xml': 1,\n      \\}\n```\n\n### The `g:ycm_show_diagnostics_ui` option\n\nWhen set, this option turns on YCM's diagnostic display features. See the\n_Diagnostic display_ section in the _User Manual_ for more details.\n\nSpecific parts of the diagnostics UI (like the gutter signs, text highlighting,\ndiagnostic echo, and auto location list population) can be individually turned on\nor off. See the other options below for details.\n\nNote that YCM's diagnostics UI is only supported for C-family languages.\n\nWhen set, this option also makes YCM remove all Syntastic checkers set for the\n`c`, `cpp`, `objc`, `objcpp`, and `cuda` filetypes since this would conflict\nwith YCM's own diagnostics UI.\n\nIf you're using YCM's identifier completer in C-family languages but cannot use\nthe clang-based semantic completer for those languages _and_ want to use the GCC\nSyntastic checkers, unset this option.\n\nDefault: `1`\n\n```viml\nlet g:ycm_show_diagnostics_ui = 1\n```\n\n### The `g:ycm_error_symbol` option\n\nYCM will use the value of this option as the symbol for errors in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_error_symbol` option\nbefore using this option's default.\n\nDefault: `\u003e\u003e`\n\n```viml\nlet g:ycm_error_symbol = '\u003e\u003e'\n```\n\n### The `g:ycm_warning_symbol` option\n\nYCM will use the value of this option as the symbol for warnings in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_warning_symbol` option\nbefore using this option's default.\n\nDefault: `\u003e\u003e`\n\n```viml\nlet g:ycm_warning_symbol = '\u003e\u003e'\n```\n\n### The `g:ycm_enable_diagnostic_signs` option\n\nWhen this option is set, YCM will put icons in Vim's gutter on lines that have a\ndiagnostic set. Turning this off will also turn off the `YcmErrorLine` and\n`YcmWarningLine` highlighting.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_enable_signs` option\nbefore using this option's default.\n\nDefault: `1`\n\n```viml\nlet g:ycm_enable_diagnostic_signs = 1\n```\n\n### The `g:ycm_enable_diagnostic_highlighting` option\n\nWhen this option is set, YCM will highlight regions of text that are related to\nthe diagnostic that is present on a line, if any.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_enable_highlighting`\noption before using this option's default.\n\nDefault: `1`\n\n```viml\nlet g:ycm_enable_diagnostic_highlighting = 1\n```\n\n### The `g:ycm_echo_current_diagnostic` option\n\nWhen this option is set to 1, YCM will echo the text of the diagnostic present\non the current line when you move your cursor to that line. If a `FixIt` is\navailable for the current diagnostic, then ` (FixIt)` is appended.\n\nIf you have a Vim that supports virtual text, you can set this option\nto the string `virtual-text`, and the diagnostic will be displayed inline with\nthe text, right aligned in the window and wrapping to the next line if there is\nnot enough space, for example:\n\n![Virtual text diagnostic demo][diagnostic-echo-virtual-text1]\n\n![Virtual text diagnostic demo][diagnostic-echo-virtual-text2]\n\n**NOTE**: It's _strongly_ recommended to also set\n`g:ycm_update_diagnostics_in_insert_mode` to `0` when using `virtual-text` for\ndiagnostics. This is due to the increased amount of distraction provided by\ndrawing diagnostics next to your input position.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_echo_current_error`\noption before using this option's default.\n\nDefault: `1`\n\nValid values:\n\n* `0` - disabled\n* `1` - echo diagnostic to the command area\n* `'virtual-text'` - display the dignostic to the right of the line in the\n  window using virtual text\n\n```viml\nlet g:ycm_echo_current_diagnostic = 1\n\" Or, when you have Vim supporting virtual text\nlet g:ycm_echo_current_diagnostic = 'virtual-text'\n```\n\n### The `g:ycm_auto_hover` option\n\nThis option controls whether or not YCM shows documentation in a popup at the\ncursor location after a short delay. Only supported in Vim.\n\nWhen this option is set to `'CursorHold'`, the popup is displayed on the\n`CursorHold` autocommand. See `:help CursorHold` for the details, but this means\nthat it is displayed after `updatetime` milliseconds.  When set to an empty\nstring, the popup is not automatically displayed.\n\nIn addition to this setting, there is the `\u003cplug\u003e(YCMHover)` mapping, which can\nbe used to manually trigger or hide the popup (it works like a toggle).\nFor example:\n\n```viml\nnmap \u003cleader\u003eD \u003cplug\u003e(YCMHover)\n```\n\nAfter dismissing the popup with this mapping, it will not be automatically\ntriggered again until the cursor is moved (i.e. `CursorMoved` autocommand).\n\nThe displayed documentation depends on what the completer for the current\nlanguage supports. It's selected heuristically in this order of preference:\n\n1. `GetHover` with `markdown` syntax\n2. `GetDoc` with no syntax\n3. `GetType` with the syntax of the current file. \n\nYou can customise this by manually setting up `b:ycm_hover` to your liking. This\nbuffer-local variable can be set to a dictionary with the following keys:\n\n* `command`: The YCM completer subcommand which should be run on hover\n* `syntax`: The syntax to use (as in `set syntax=`) in the popup window for\n  highlighting.\n* `popup_params`: The params passed to a popup window which gets opened.\n\nFor example, to use C/C++ syntax highlighting in the popup for C-family\nlanguages, add something like this to your vimrc:\n\n```viml\naugroup MyYCMCustom\n  autocmd!\n  autocmd FileType c,cpp let b:ycm_hover = {\n    \\ 'command': 'GetDoc',\n    \\ 'syntax': \u0026filetype\n    \\ }\naugroup END\n```\n\nYou can also modify the opened popup with `popup_params` key.\nFor example, you can limit the popup's maximum width and add a border to it:\n\n```viml\naugroup MyYCMCustom\n  autocmd!\n  autocmd FileType c,cpp let b:ycm_hover = {\n    \\ 'command': 'GetDoc',\n    \\ 'syntax': \u0026filetype\n    \\ 'popup_params': {\n    \\     'maxwidth': 80,\n    \\     'border': [],\n    \\     'borderchars': ['─', '│', '─', '│', '┌', '┐', '┘', '└'],\n    \\   },\n    \\ }\naugroup END\n```\nSee `:help popup_create-arguments` for the list of available popup window options.\n\nDefault: `'CursorHold'`\n\n### The `g:ycm_filter_diagnostics` option\n\nThis option controls which diagnostics will be rendered by YCM. This option\nholds a dictionary of key-values, where the keys are Vim's filetype strings\ndelimited by commas and values are dictionaries describing the filter.\n\nA filter is a dictionary of key-values, where the keys are the type of filter,\nand the value is a list of arguments to that filter. In the case of just a\nsingle item in the list, you may omit the brackets and just provide the argument\ndirectly. If any filter matches a diagnostic, it will be dropped and YCM will\nnot render it.\n\nThe following filter types are supported:\n\n- \"regex\": Accepts a string [regular expression][python-re]. This type matches\nwhen the regex (treated as case-insensitive) is found anywhere in the diagnostic\ntext (`re.search`, not `re.match`)\n- \"level\": Accepts a string level, either \"warning\" or \"error.\" This type\nmatches when the diagnostic has the same level, that is,\nspecifying `level: \"error\"` will remove **all** errors from the diagnostics.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's [Python's][python-re].\n\nDefault: `{}`\n\nThe following example will do, for Java filetype only:\n- Remove **all** error level diagnostics, and,\n- Also remove anything that contains `ta\u003csomething\u003eco`\n\n```viml\nlet g:ycm_filter_diagnostics = {\n  \\ \"java\": {\n  \\      \"regex\": [ \"ta.+co\", ... ],\n  \\      \"level\": \"error\",\n  \\      ...\n  \\    }\n  \\ }\n```\n\n### The `g:ycm_always_populate_location_list` option\n\nWhen this option is set, YCM will populate the location list automatically every\ntime it gets new diagnostic data. This option is off by default so as not to\ninterfere with other data you might have placed in the location list.\n\nSee `:help location-list` in Vim to learn more about the location list.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the\n`g:syntastic_always_populate_loc_list` option before using this option's\ndefault.\n\nNote: if YCM's errors aren't visible, it might be that YCM is updating an older location list. See `:help :lhistory` and `:lolder`.\n\nDefault: `0`\n\n```viml\nlet g:ycm_always_populate_location_list = 0\n```\n\n### The `g:ycm_open_loclist_on_ycm_diags` option\n\nWhen this option is set, `:YcmDiags` will automatically open the location list\nafter forcing a compilation and filling the list with diagnostic data.\n\nSee `:help location-list` in Vim to learn more about the location list.\n\nDefault: `1`\n\n```viml\nlet g:ycm_open_loclist_on_ycm_diags = 1\n```\n\n### The `g:ycm_complete_in_comments` option\n\nWhen this option is set to `1`, YCM will show the completion menu even when\ntyping inside comments.\n\nDefault: `0`\n\n```viml\nlet g:ycm_complete_in_comments = 0\n```\n\n### The `g:ycm_complete_in_strings` option\n\nWhen this option is set to `1`, YCM will show the completion menu even when\ntyping inside strings.\n\nNote that this is turned on by default so that you can use the filename\ncompletion inside strings. This is very useful for instance in C-family files\nwhere typing `#include \"` will trigger the start of filename completion. If you\nturn off this option, you will turn off filename completion in such situations\nas well.\n\nDefault: `1`\n\n```viml\nlet g:ycm_complete_in_strings = 1\n```\n\n### The `g:ycm_collect_identifiers_from_comments_and_strings` option\n\nWhen this option is set to `1`, YCM's identifier completer will also collect\nidentifiers from strings and comments. Otherwise, the text in comments and\nstrings will be ignored.\n\nDefault: `0`\n\n```viml\nlet g:ycm_collect_identifiers_from_comments_and_strings = 0\n```\n\n### The `g:ycm_collect_identifiers_from_tags_files` option\n\nWhen this option is set to `1`, YCM's identifier completer will also collect\nidentifiers from tags files. The list of tags files to examine is retrieved from\nthe `tagfiles()` Vim function which examines the `tags` Vim option. See `:h\n'tags'` for details.\n\nYCM will re-index your tags files if it detects that they have been modified.\n\nThe only supported tag format is the [Exuberant Ctags format][ctags-format]. The\nformat from \"plain\" ctags is NOT supported. Ctags needs to be called with the\n`--fields=+l` option (that's a lowercase `L`, not a one) because YCM needs the\n`language:\u003clang\u003e` field in the tags output.\n\nSee the _FAQ_ for pointers if YCM does not appear to read your tag files.\n\nThis option is off by default because it makes Vim slower if your tags are on a\nnetwork directory.\n\nDefault: `0`\n\n```viml\nlet g:ycm_collect_identifiers_from_tags_files = 0\n```\n\n### The `g:ycm_seed_identifiers_with_syntax` option\n\nWhen this option is set to `1`, YCM's identifier completer will seed its\nidentifier database with the keywords of the programming language you're\nwriting.\n\nSince the keywords are extracted from the Vim syntax file for the filetype, all\nkeywords may not be collected, depending on how the syntax file was written.\nUsually at least 95% of the keywords are successfully extracted.\n\nDefault: `0`\n\n```viml\nlet g:ycm_seed_identifiers_with_syntax = 0\n```\n\n### The `g:ycm_extra_conf_vim_data` option\n\nIf you're using semantic completion for C-family files, this option might come\nhandy; it's a way of sending data from Vim to your `Settings` function in\nyour `.ycm_extra_conf.py` file.\n\nThis option is supposed to be a list of VimScript expression strings that are\nevaluated for every request to the [ycmd server][ycmd] and then passed to your\n`Settings` function as a `client_data` keyword argument.\n\nFor instance, if you set this option to `['v:version']`, your `Settings`\nfunction will be called like this:\n\n```python\n# The '801' value is of course contingent on Vim 8.1; in 8.0 it would be '800'\nSettings( ..., client_data = { 'v:version': 801 } )\n```\n\nSo the `client_data` parameter is a dictionary mapping Vim expression strings to\ntheir values at the time of the request.\n\nThe correct way to define parameters for your `Settings` function:\n\n```python\ndef Settings( **kwargs ):\n```\n\nYou can then get to `client_data` with `kwargs['client_data']`.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_extra_conf_vim_data = []\n```\n\n### The `g:ycm_server_python_interpreter` option\n\nYCM will by default search for an appropriate Python interpreter on your system.\nYou can use this option to override that behavior and force the use of a\nspecific interpreter of your choosing.\n\n**NOTE:** This interpreter is only used for the [ycmd server][ycmd]. The YCM\nclient running inside Vim always uses the Python interpreter that's embedded\ninside Vim.\n\nDefault: `''`\n\n```viml\nlet g:ycm_server_python_interpreter = ''\n```\n\n### The `g:ycm_keep_logfiles` option\n\nWhen this option is set to `1`, YCM and the [ycmd completion server][ycmd] will\nkeep the logfiles around after shutting down (they are deleted on shutdown by\ndefault).\n\nTo see where the log files are, call `:YcmDebugInfo`.\n\nDefault: `0`\n\n```viml\nlet g:ycm_keep_logfiles = 0\n```\n\n### The `g:ycm_log_level` option\n\nThe logging level that YCM and the [ycmd completion server][ycmd] use. Valid\nvalues are the following, from most verbose to least verbose:\n- `debug`\n- `info`\n- `warning`\n- `error`\n- `critical`\n\nNote that `debug` is _very_ verbose.\n\nDefault: `info`\n\n```viml\nlet g:ycm_log_level = 'info'\n```\n\n### The `g:ycm_auto_start_csharp_server` option\n\nWhen set to `1`, the OmniSharp-Roslyn server will be automatically started\n(once per Vim session) when you open a C# file.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_start_csharp_server = 1\n```\n\n### The `g:ycm_auto_stop_csharp_server` option\n\nWhen set to `1`, the OmniSharp-Roslyn server will be automatically stopped upon\nclosing Vim.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_stop_csharp_server = 1\n```\n\n### The `g:ycm_csharp_server_port` option\n\nWhen g:ycm_auto_start_csharp_server is set to `1`, specifies the port for\nthe OmniSharp-Roslyn server to listen on. When set to `0` uses an unused port provided\nby the OS.\n\nDefault: `0`\n\n```viml\nlet g:ycm_csharp_server_port = 0\n```\n\n### The `g:ycm_csharp_insert_namespace_expr` option\n\nBy default, when YCM inserts a namespace, it will insert the `using` statement\nunder the nearest `using` statement. You may prefer that the `using` statement is\ninserted somewhere, for example, to preserve sorting. If so, you can set this\noption to override this behavior.\n\nWhen this option is set, instead of inserting the `using` statement itself, YCM\nwill set the global variable `g:ycm_namespace_to_insert` to the namespace to\ninsert, and then evaluate this option's value as an expression. The option's\nexpression is responsible for inserting the namespace - the default insertion\nwill not occur.\n\nDefault: ''\n\n```viml\nlet g:ycm_csharp_insert_namespace_expr = ''\n```\n\n### The `g:ycm_add_preview_to_completeopt` option\n\nWhen this option is set to `1`, YCM will add the `preview` string to Vim's\n`completeopt` option (see `:h completeopt`). If your `completeopt` option\nalready has `preview` set, there will be no effect. Alternatively, when set to\n`popup` and your version of Vim supports popup windows (see `:help popup`), the\n`popup` string will be used instead. You can see the current state of your\n`completeopt` setting with `:set completeopt?` (yes, the question mark is\nimportant).\n\nWhen `preview` is present in `completeopt`, YCM will use the `preview` window at\nthe top of the file to store detailed information about the current completion\ncandidate (but only if the candidate came from the semantic engine). For\ninstance, it would show the full function prototype and all the function\noverloads in the window if the current completion is a function name.\n\nWhen `popup` is present in `completeopt`, YCM will instead use a `popup`\nwindow to the side of the completion popup for storing detailed information\nabout the current completion candidate. In addition, YCM may truncate the\ndetailed completion information in order to give the popup sufficient room\nto display that detailed information.\n\nDefault: `0`\n\n```viml\nlet g:ycm_add_preview_to_completeopt = 0\n```\n\n### The `g:ycm_autoclose_preview_window_after_completion` option\n\nWhen this option is set to `1`, YCM will auto-close the `preview` window after\nthe user accepts the offered completion string. If there is no `preview` window\ntriggered because there is no `preview` string in `completeopt`, this option is\nirrelevant. See the `g:ycm_add_preview_to_completeopt` option for more details.\n\nDefault: `0`\n\n```viml\nlet g:ycm_autoclose_preview_window_after_completion = 0\n```\n\n### The `g:ycm_autoclose_preview_window_after_insertion` option\n\nWhen this option is set to `1`, YCM will auto-close the `preview` window after\nthe user leaves insert mode. This option is irrelevant if\n`g:ycm_autoclose_preview_window_after_completion` is set or if no `preview`\nwindow is triggered. See the `g:ycm_add_preview_to_completeopt` option for more\ndetails.\n\nDefault: `0`\n\n```viml\nlet g:ycm_autoclose_preview_window_after_insertion = 0\n```\n\n### The `g:ycm_max_diagnostics_to_display` option\n\nThis option controls the maximum number of diagnostics shown to the user when\nerrors or warnings are detected in the file. This option is only relevant for\nthe C-family, C#, Java, JavaScript, and TypeScript languages.\n\nA special value of `0` means there is no limit.\n\nDefault: `30`\n\n```viml\nlet g:ycm_max_diagnostics_to_display = 30\n```\n\n### The `g:ycm_key_list_select_completion` option\n\nThis option controls the key mappings used to select the first completion\nstring.  Invoking any of them repeatedly cycles forward through the completion\nlist.\n\nSome users like adding `\u003cEnter\u003e` to this list.\n\nDefault: `['\u003cTAB\u003e', '\u003cDown\u003e']`\n\n```viml\nlet g:ycm_key_list_select_completion = ['\u003cTAB\u003e', '\u003cDown\u003e']\n```\n\n### The `g:ycm_key_list_previous_completion` option\n\nThis option controls the key mappings used to select the previous completion\nstring. Invoking any of them repeatedly cycles backward through the completion\nlist.\n\nNote that one of the defaults is `\u003cS-TAB\u003e` which means Shift-TAB. That mapping\nwill probably only work in GUI Vim (Gvim or MacVim) and not in plain console Vim\nbecause the terminal usually does not forward modifier key combinations to Vim.\n\nDefault: `['\u003cS-TAB\u003e', '\u003cUp\u003e']`\n\n```viml\nlet g:ycm_key_list_previous_completion = ['\u003cS-TAB\u003e', '\u003cUp\u003e']\n```\n\n### The `g:ycm_key_list_stop_completion` option\n\nThis option controls the key mappings used to close the completion menu. This is\nuseful when the menu is blocking the view, when you need to insert the `\u003cTAB\u003e`\ncharacter, or when you want to expand a snippet from [UltiSnips][] and navigate\nthrough it.\n\nDefault: `['\u003cC-y\u003e']`\n\n```viml\nlet g:ycm_key_list_stop_completion = ['\u003cC-y\u003e']\n```\n\n### The `g:ycm_key_invoke_completion` option\n\nThis option controls the key mapping used to invoke the completion menu for\nsemantic completion. By default, semantic completion is triggered automatically\nafter typing characters appropriate for the language, such as `.`, `-\u003e`, `::`,\netc. in insert mode (if semantic completion support has been compiled in). This\nkey mapping can be used to trigger semantic completion anywhere. Useful for\nsearching for top-level functions and classes.\n\nConsole Vim (not Gvim or MacVim) passes `\u003cNul\u003e` to Vim when the user types\n`\u003cC-Space\u003e` so YCM will make sure that `\u003cNul\u003e` is used in the map command when\nyou're editing in console Vim, and `\u003cC-Space\u003e` in GUI Vim. This means that you\ncan just press `\u003cC-Space\u003e` in both the console and GUI Vim and YCM will do the right\nthing.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nDefault: `\u003cC-Space\u003e`\n\n```viml\nlet g:ycm_key_invoke_completion = '\u003cC-Space\u003e'\n```\n\n### The `g:ycm_key_detailed_diagnostics` option\n\nThis option controls the key mapping used to show the full diagnostic text when\nthe user's cursor is on the line with the diagnostic. It basically calls\n`:YcmShowDetailedDiagnostic`.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nIf you prefer the detailed diagnostic to be shown in a popup, then\n`let g:ycm_show_detailed_diag_in_popup=1`.\n\nDefault: `\u003cleader\u003ed`\n\n```viml\nlet g:ycm_key_detailed_diagnostics = '\u003cleader\u003ed'\n```\n\n### The `g:ycm_show_detailed_diag_in_popup` option\n\nMakes `:YcmShowDetailedDiagnostic` always show in a popup rather than echoing to\nthe command line.\n\nDefault: 0\n\n```viml\nlet g:ycm_show_detailed_diag_in_popup = 0\n```\n\n### The `g:ycm_global_ycm_extra_conf` option\n\nNormally, YCM searches for a `.ycm_extra_conf.py` file for compilation flags\n(see the User Guide for more details on how this works). This option specifies\na fallback path to a config file which is used if no `.ycm_extra_conf.py` is\nfound.\n\nYou can place such a global file anywhere in your filesystem.\n\nDefault: `''`\n\n```viml\nlet g:ycm_global_ycm_extra_conf = ''\n```\n\n### The `g:ycm_confirm_extra_conf` option\n\nWhen this option is set to `1` YCM will ask once per `.ycm_extra_conf.py` file\nif it is safe to be loaded. This is to prevent the execution of malicious code\nfrom a `.ycm_extra_conf.py` file you didn't write.\n\nTo selectively get YCM to ask/not ask about loading certain `.ycm_extra_conf.py`\nfiles, see the `g:ycm_extra_conf_globlist` option.\n\nDefault: `1`\n\n```viml\nlet g:ycm_confirm_extra_conf = 1\n```\n\n### The `g:ycm_extra_conf_globlist` option\n\nThis option is a list that may contain several globbing patterns. If a pattern\nstarts with a `!` all `.ycm_extra_conf.py` files matching that pattern will be\nblacklisted, that is they won't be loaded and no confirmation dialog will be\nshown. If a pattern does not start with a `!` all files matching that pattern\nwill be whitelisted. Note that this option is not used when confirmation is\ndisabled using `g:ycm_confirm_extra_conf` and that items earlier in the list\nwill take precedence over the later ones.\n\nRules:\n\n* `*`       matches everything\n* `?`       matches any single character\n* `[seq]`   matches any character in seq\n* `[!seq]`  matches any char not in seq\n\nExample:\n\n```viml\nlet g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']\n```\n\n* The first rule will match everything contained in the `~/dev` directory so\n  `.ycm_extra_conf.py` files from there will be loaded.\n* The second rule will match everything in the home directory so a\n  `.ycm_extra_conf.py` file from there won't be loaded.\n* As the first rule takes precedence everything in the home directory excluding\n  the `~/dev` directory will be blacklisted.\n\n**NOTE:** The glob pattern is first expanded with Python's\n`os.path.expanduser()` and then resolved with `os.path.abspath()` before being\nmatched against the filename.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_extra_conf_globlist = []\n```\n\n### The `g:ycm_filepath_completion_use_working_dir` option\n\nBy default, YCM's filepath completion will interpret relative paths like `../`\nas being relative to the folder of the file of the currently active buffer.\nSetting this option will force YCM to always interpret relative paths as being\nrelative to Vim's current working directory.\n\nDefault: `0`\n\n```viml\nlet g:ycm_filepath_completion_use_working_dir = 0\n```\n\n### The `g:ycm_semantic_triggers` option\n\nThis option controls the character-based triggers for the various semantic\ncompletion engines. The option holds a dictionary of key-values, where the keys\nare Vim's filetype strings delimited by commas and values are lists of strings,\nwhere the strings are the triggers.\n\nSetting key-value pairs on the dictionary _adds_ semantic triggers to the\ninternal default set (listed below). You cannot remove the default triggers,\nonly add new ones.\n\nA \"trigger\" is a sequence of one or more characters that trigger semantic\ncompletion when typed. For instance, C++ (`cpp` filetype) has `.` listed as a\ntrigger. So when the user types `foo.`, the semantic engine will trigger and\nserve `foo`'s list of member functions and variables. Since C++ also has `-\u003e`\nlisted as a trigger, the same thing would happen when the user typed `foo-\u003e`.\n\nIt's also possible to use a regular expression as a trigger. You have to prefix\nyour trigger with `re!` to signify it's a regex trigger. For instance,\n`re!\\w+\\.` would only trigger after the `\\w+\\.` regex matches.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's [Python's][python-re].\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_semantic_triggers =  {\n  \\   'c': ['-\u003e', '.'],\n  \\   'objc': ['-\u003e', '.', 're!\\[[_a-zA-Z]+\\w*\\s', 're!^\\s*[^\\W\\d]\\w*\\s',\n  \\            're!\\[.*\\]\\s'],\n  \\   'ocaml': ['.', '#'],\n  \\   'cpp,cuda,objcpp': ['-\u003e', '.', '::'],\n  \\   'perl': ['-\u003e'],\n  \\   'php': ['-\u003e', '::'],\n  \\   'cs,d,elixir,go,groovy,java,javascript,julia,perl6,python,scala,typescript,vb': ['.'],\n  \\   'ruby,rust': ['.', '::'],\n  \\   'lua': ['.', ':'],\n  \\   'erlang': [':'],\n  \\ }\n```\n\n### The `g:ycm_cache_omnifunc` option\n\nSome omnicompletion engines do not work well with the YCM cache—in particular,\nthey might not produce all possible results for a given prefix. By unsetting\nthis option you can ensure that the omnicompletion engine is re-queried on every\nkeypress. That will ensure all completions will be presented but might cause\nstuttering and lag if the omnifunc is slow.\n\nDefault: `1`\n\n```viml\nlet g:ycm_cache_omnifunc = 1\n```\n\n### The `g:ycm_use_ultisnips_completer` option\n\nBy default, YCM will query the UltiSnips plugin for possible completions of\nsnippet triggers. This option can turn that behavior off.\n\nDefault: `1`\n\n```viml\nlet g:ycm_use_ultisnips_completer = 1\n```\n\n### The `g:ycm_goto_buffer_command` option\n\nDefines where `GoTo*` commands result should be opened. Can take one of the\nfollowing values: `'same-buffer'`, `'split'`, or `'split-or-existing-window'`.\nIf this option is set to the `'same-buffer'` but current buffer can not be\nswitched (when buffer is modified and `nohidden` option is set), then result\nwill be opened in a split. When the option is set to\n`'split-or-existing-window'`, if the result is already open in a window of the\ncurrent tab page (or any tab pages with the `:tab` modifier; see below), it will\njump to that window. Otherwise, the result will be opened in a split as if the\noption was set to `'split'`.\n\nTo customize the way a new window is split, prefix the `GoTo*` command with one\nof the following modifiers: `:aboveleft`, `:belowright`, `:botright`,\n`:leftabove`, `:rightbelow`, `:topleft`, and `:vertical`. For instance, to\nsplit vertically to the right of the current window, run the command:\n\n```viml\n:rightbelow vertical YcmCompleter GoTo\n```\n\nTo open in a new tab page, use the `:tab` modifier with the `'split'` or\n`'split-or-existing-window'` options e.g.:\n\n```viml\n:tab YcmCompleter GoTo\n```\n\nDefault: `'same-buffer'`\n\n```viml\nlet g:ycm_goto_buffer_command = 'same-buffer'\n```\n\n### The `g:ycm_disable_for_files_larger_than_kb` option\n\nDefines the max size (in Kb) for a file to be considered for completion. If this\noption is set to 0 then no check is made on the size of the file you're opening.\n\nDefault: 1000\n\n```viml\nlet g:ycm_disable_for_files_larger_than_kb = 1000\n```\n\n### The `g:ycm_use_clangd` option\n\nThis option controls whether **clangd** should be used as a completion engine for\nC-family languages. Can take one of the following values: `1`, `0`, with\nmeanings:\n\n- `1`: YCM will use clangd if clangd binary exists in third party or it was\nprovided with `ycm_clangd_binary_path` option.\n- `0`: YCM will never use clangd completer.\n\nDefault: `1`\n\n```viml\nlet g:ycm_use_clangd = 1\n```\n\n### The `g:ycm_clangd_binary_path` option\n\nWhen `ycm_use_clangd` option is set to `1`, this option sets the path to\n**clangd** binary.\n\nDefault: `''`\n\n```viml\nlet g:ycm_clangd_binary_path = ''\n```\n\n### The `g:ycm_clangd_args` option\n\nThis option controls the command line arguments passed to the clangd binary. It\nappends new options and overrides the existing ones.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_clangd_args = []\n```\n\n### The `g:ycm_clangd_uses_ycmd_caching` option\n\nThis option controls which ranking and filtering algorithm to use for completion\nitems. It can take values:\n\n- `1`: Uses ycmd's caching and filtering logic.\n- `0`: Uses clangd's caching and filtering logic.\n\nDefault: `1`\n\n```viml\nlet g:ycm_clangd_uses_ycmd_caching = 1\n```\n\n### The `g:ycm_language_server` option\n\nThis option lets YCM use an arbitrary Language Server Protocol (LSP) server, not\nunlike many other completion systems.  The officially supported completers are\nfavoured over custom LSP ones, so overriding an existing completer means first\nmaking sure YCM won't choose that existing completer in the first place.\n\nA simple working example of this option can be found in the section called\n[\"Semantic Completion for Other Languages\"](#semantic-completion-for-other-languages).\n\nMany working examples can be found in the YCM [lsp-examples][] repo.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_language_server = []\n```\n\n### The `g:ycm_disable_signature_help` option\n\nThis option allows you to disable all signature help for all completion engines.\nThere is no way to disable it per-completer.\n\nDefault: `0`\n\n```viml\n\" Disable signature help\nlet g:ycm_disable_signature_help = 1\n```\n\n### The `g:ycm_signature_help_disable_syntax` option\n\nSet this to 1 to disable syntax highlighting in the signature help popup. Thiis\ncan help if your colourscheme doesn't work well with the default highliting and\ninverse video.\n\nDefault: `0`\n\n```viml\n\" Disable signature help syntax highliting\nlet g:ycm_signature_help_disable_syntax = 1\n```\n\n### The `g:ycm_gopls_binary_path` option\n\nIn case the system-wide `gopls` binary is newer than the bundled one, setting\nthis option to the path of the system-wide `gopls` would make YCM use that one\ninstead.\n\nIf the path is just `gopls`, YCM will search in `$PATH`.\n\n\n### The `g:ycm_gopls_args` option\n\nSimilar to [the `g:ycm_clangd_args`](#the-gycm-clangd-args), this option allows\npassing additional flags to the `gopls` command line.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_gopls_args = []\n```\n\n\n### The `g:ycm_rls_binary_path` and `g:ycm_rustc_binary_path` options\n\nYCM no longer uses RLS for rust, and these options are therefore no longer\nsupported.\n\nTo use a custom rust-analyzer, see `g:ycm_rust_toolchain_root`.\n\n### The `g:ycm_rust_toolchain_root` option\n\nOptionally specify the path to a custom rust toolchain including at least a\nsupported version of `rust-analyzer`.\n\n\n### The `g:ycm_tsserver_binary_path` option\n\nSimilar to [the `gopls` path](#the-gycm-gopls-binaty-path), this option\ntells YCM where is the TSServer executable located.\n\n### The `g:ycm_roslyn_binary_path` option\n\nSimilar to [the `gopls` path](#the-gycm-gopls-binaty-path), this option\ntells YCM where is the Omnisharp-Roslyn executable located.\n\n### The `g:ycm_update_diagnostics_in_insert_mode` option\n\nWith async diagnostics, LSP servers might send new diagnostics mid-typing.\nIf seeing these new diagnostics while typing is not desired, this option can\nbe set to 0.\n\nWhen this option is set to `0`, diagnostic signs, virtual text, and highlights\nare cleared when entering insert mode and replaced when leaving insert mode.\nThis reduces visual noise while editing.\n\nIn addition, this option is recommended when `g:ycm_echo_current_diagnostic` is\nset to `virtual-text` as it prevents updating the virtual text while you are\ntyping.\n\nDefault: `1`\n\n```viml\nlet g:ycm_update_diagnostics_in_insert_mode = 1\n```\n\nFAQ\n---\n\nThe FAQ section has been moved to the [wiki][wiki-faq].\n\nContributor Code of Conduct\n---------------------------\n\nPlease note that this project is released with a [Contributor Code of\nConduct][ccoc]. By participating in this project you agree to abide by its\nterms.\n\n\nContact\n-------\n\nIf you have questions about the plugin or need help, please join the [Gitter\nroom][gitter] or use the [ycm-users][] mailing list.\n\nIf you have bug reports or feature suggestions, please use the [issue\ntracker][tracker]. Before you do, please carefully read\n[CONTRIBUTING.md][contributing-md] as this asks for important diagnostics which\nthe team will use to help get you going.\n\nThe latest version of the plugin is available at\n\u003chttps://ycm-core.github.io/YouCompleteMe/\u003e.\n\nThe author's homepage is \u003chttps://val.markovic.io\u003e.\n\nPlease do **NOT** go to #vim, Reddit, or Stack Overflow for support. Please\ncontact the YouCompleteMe maintainers directly using the [contact\ndetails](#contact).\n\nLicense\n-------\n\nThis software is licensed under the [GPL v3 license][gpl].\n© 2015-2018 YouCompleteMe contributors\n\nSponsorship\n-----------\n\nIf you like YCM so much that you're willing to part with your hard-earned cash, please consider donating to one of the following charities, which are meaningful to the current maintainers (in no particular order):\n\n* [Hector's Greyhound Rescue](https://www.hectorsgreyhoundrescue.org)\n* [Be Humane](https://www.budihuman.rs/en)\n* [Cancer Research UK](https://www.cancerresearchuk.org)\n* [ICCF Holland](https://iccf.nl)\n* Any charity of your choosing.\n\nPlease note: The YCM maintainers do not specifically endorse nor necessarily have any relationship with the above charities. Disclosure: It is noted that one key maintainer is a family with Trustees of Greyhound Rescue Wales.\n\n\n[ycmd]: https://github.com/ycm-core/ycmd\n[Clang]: https://clang.llvm.org/\n[vundle]: https://github.com/VundleVim/Vundle.vim#about\n[brew]: https://brew.sh\n[cmake-download]: https://cmake.org/download/\n[macvim]: https://macvim-dev.github.io/macvim/\n[vimrc]: https://vimhelp.appspot.com/starting.txt.html#vimrc\n[gpl]: https://www.gnu.org/copyleft/gpl.html\n[vim]: https://www.vim.org/\n[syntastic]: https://github.com/scrooloose/syntastic\n[lightline]: https://github.com/itchyny/lightline.vim\n[ycm_flags_example]: https://github.com/ycm-core/YouCompleteMe/blob/master/.ycm_extra_conf.py\n[ycmd_flags_example]: https://raw.githubusercontent.com/ycm-core/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py\n[compdb]: https://clang.llvm.org/docs/JSONCompilationDatabase.html\n[subsequence]: https://en.wikipedia.org/wiki/Subsequence\n[listtoggle]: https://github.com/Valloric/ListToggle\n[vim-build]: https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source\n[tracker]: https://github.com/ycm-core/YouCompleteMe/issues?state=open\n[completer-api]: https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/completer.py\n[eclim]: http://eclim.org/\n[jedi]: https://github.com/davidhalter/jedi\n[ultisnips]: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt\n[ctags-format]: http://ctags.sourceforge.net/FORMAT\n[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users\n[omnisharp-roslyn]: https://github.com/OmniSharp/omnisharp-roslyn\n[python-re]: https://docs.python.org/2/library/re.html#regular-expression-syntax\n[Bear]: https://github.com/rizsotto/Bear\n[ygen]: https://github.com/rdnetto/YCM-Generator\n[Gopls]: https://github.com/golang/go/wiki/gopls\n[gopls-preferences]: https://github.com/golang/tools/blob/master/internal/lsp/server.go\n[TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server\n[jsconfig.json]: https://code.visualstudio.com/docs/languages/jsconfig\n[tsconfig.json]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html\n[vim-win-download]: https://github.com/vim/vim-win32-installer/releases\n[python-win-download]: https://www.python.org/downloads/windows/\n[visual-studio-download]: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools\u0026rel=16\n[mono-install-macos]: https://www.mono-project.com/download/stable/\n[mono-install-linux]: https://www.mono-project.com/download/stable/#download-lin\n[go-install]: https://golang.org/doc/install\n[npm-install]: https://docs.npmjs.com/getting-started/installing-node#1-install-nodejs--npm\n[tern-instructions]: https://github.com/ycm-core/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern\n[libclang-instructions]: https://github.com/ycm-core/YouCompleteMe/wiki/C-family-Semantic-Completion-through-libclang\n[Tern]: https://ternjs.net\n[rls]: https://github.com/rust-lang/rls\n[rust-analyzer]: https://rust-analyzer.github.io\n[rust-src]: https://www.rust-lang.org/downloads.html\n[add-msbuild-to-path]: https://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1\n[ccoc]: https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\n[gitter]: https://gitter.im/Valloric/YouCompleteMe\n[ninja-compdb]: https://ninja-build.org/manual.html\n[++enc]: http://vimdoc.sourceforge.net/htmldoc/editing.html#++enc\n[contributing-md]: https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md\n[jdt.ls]: https://github.com/eclipse/eclipse.jdt.ls\n[jdk-install]: https://adoptium.net/en-GB/temurin/releases\n[mvn-project]: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html\n[eclipse-project]: https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html\n[gradle-project]: https://docs.gradle.org/current/userguide/tutorial_java_projects.html\n[eclipse-dot-project]: https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html\n[eclipse-dot-classpath]: https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html\n[ycmd-eclipse-project]: https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_eclipse_project\n[ycmd-mvn-pom-xml]: https://github.com/ycm-core/ycmd/blob/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_maven_project/pom.xml\n[ycmd-gradle-project]: https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_gradle_project\n[jdtls-preferences]: https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java\n[diacritic]: https://www.unicode.org/glossary/#diacritic\n[clangd]: https://clang.llvm.org/extra/clangd.html\n[vimspector]: https://github.com/puremourning/vimspector\n[compiledb]: https://pypi.org/project/compiledb/\n[signature-help-pr]: https://github.com/ycm-core/ycmd/pull/1255\n[wiki-faq]: https://github.com/ycm-core/YouCompleteMe/wiki/FAQ\n[wiki-full-install]: https://github.com/ycm-core/YouCompleteMe/wiki/Full-Installation-Guide\n[wiki-troubleshooting]: https://github.com/ycm-core/YouCompleteMe/wiki/Troubleshooting-steps-for-ycmd-server-SHUT-DOWN\n[lsp-examples]: https://github.com/ycm-core/lsp-examples\n[diagnostic-echo-virtual-text1]: https://user-images.githubusercontent.com/10584846/185707973-39703699-0263-47d3-82ac-639d52259bea.png\n[diagnostic-echo-virtual-text2]: https://user-images.githubusercontent.com/10584846/185707993-14ff5fd7-c082-4e5a-b825-f1364e619b6a.png\n[jedi-refactor-doc]: https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.extract_variable\n","funding_links":[],"categories":["Install Vundle","Python","Integrated Development Environment","HarmonyOS","Cross-Platform","文本编辑器扩展","vim","Emacs [elpy](https://github.com/jorgenschaefer/elpy)：Emacs Python 开发环境。","Uncategorized"],"sub_categories":["Caveats","Windows Manager","JavaScript","YAML"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycm-core%2FYouCompleteMe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fycm-core%2FYouCompleteMe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycm-core%2FYouCompleteMe/lists"}