Coc.nvim
lastmod 2025-12-05created 2020-05-1553 edits
Intellisense engine for Vim8 & Neovim, full language server protocol support as VSCode.
How to install
Using vim-plug
Using NeoBundle
Use this work-around to check out the recommended release branch:
Extensions
- Extensions directory:
$HOME/.config/coc/extensions
- coc-clangd - clang support. Requires installing clangd.
- coc-vetur - vue.js support. Requires installing vls.
- coc-tsserver - typescript support.
- coc-snippets
-
coc-python- DEPRECATED - coc-pyright (pyright; python)
- coc-jedi (jedi; python)
Full list:
- Using coc extensions · neoclide/coc.nvim Wiki
- coc-angular
- coc-ansible
- coc-astro
- coc-black-formatter
- coc-blade
- coc-browser
- coc-calc
- coc-cfn-lint
- coc-clangd
- coc-clang-format-style-options
- coc-cmake
- coc-copilot
- coc-css
- coc-cssmodules
- coc-deno
- coc-diagnostic
- coc-discord
- coc-discord-rpc
- coc-dash-complete
- coc-dot-complete
- coc-docker
- coc-dlang
- coc-ecdict
- coc-elixir
- coc-ember
- coc-glint
- coc-emmet
- coc-erlang_ls
- coc-esbonio
- coc-eslint
- coc-explorer
- coc-floaterm
- coc-flow
- coc-flutter
- coc-fsharp
- coc-fzf
- coc-fzf-preview
- coc-gist
- coc-git
- coc-glslx
- coc-go
- coc-golines
- coc-graphql
- coc-haxe
- coc-highlight
- coc-html
- coc-htmldjango
- coc-htmlhint
- coc-html-css-support
- coc-intelephense
- coc-java
- coc-jedi
- coc-json
- coc-julia
- coc-just-complete
- coc-laravel
- coc-lists
- coc-lightbulb
- coc-lsp-wl
- coc-ltex
- coc-lua
- coc-markdownlint
- coc-markdown-preview-enhanced
- coc-markmap
- coc-metals
- coc-mypy
- coc-nav
- coc-nginx
- coc-omnisharp
- coc-perl
- coc-phpactor
- coc-phpls
- coc-phpstan
- coc-php-cs-fixer
- coc-psalm
- coc-powershell
- coc-prettier
- coc-prisma
- coc-pydocstring
- coc-pylsp
- coc-pyright
- coc-python
- coc-r-lsp
- coc-reason
- coc-rls
- coc-rome
- coc-ruff
- coc-rust-analyzer
- coc-sh
- coc-stylelintplus
- coc-stylelint
- coc-snippets
- coc-solargraph
- coc-solidity
- coc-sourcekit
- coc-spell-checker
- coc-sql
- coc-sqlfluff
- coc-stylua
- coc-sumneko-lua
- coc-svelte
- coc-svg
- coc-swagger
- coc-symbol-line
- coc-tabnine
- coc-tailwindcss
- coc-tailwindcss3
- coc-tasks
- coc-texlab
- coc-thrift-syntax-support
- coc-toml
- coc-translator
- coc-tsserver
- coc-twoslash-queries
- coc-unocss
- coc-vetur
- coc-volar
- coc-vimlsp
- coc-webview
- coc-xml
- coc-yaml
- coc-yank
- coc-zig
- coc-zls
Show Signature Help
Use this when you want to see the parameter/argument list popup. Since this mostly comes up in Insert Mode, use a keymap like the following:
Here, CTRL-\ CTRL-O is used to run a normal mode command without leaving insert mode. See Vi#Quick command in insert mode.
Configuration file
- User configuration file
- File path -
$HOME/.config/nvim/coc-settings.json - Command to open the file -
:CocConfig
- Workspace configuration file
- Command to open the file -
:CocLocalConfig - File path -
.vim/coc-settings.json
Variables expand
Variables would be expanded in string values of configuration, supported variables:
-
${userHome}- the path of the user's home folder -
${cwd}- current working directory of vim
some additional variables see:
Configuration file resolve
To enable intellisense for coc-settings.json, install the json language extension coc-json by:
In your vim.
Built in configurations
Checkout :h coc-config for all built in configurations.
Examples
{
"clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/14.0.0/clangd_14.0.0/bin/clangd",
"python.pythonPath": "python",
}
Workspace
Unlike VSCode, vim does not support workspaces. The solution is to resolve the workspace folder from the opened file.
Resolve workspace folder
A list of file/folder names is used to resolve the workspace folder, and the patterns can come from:
-
b:coc_root_patternsvariable of current buffer. -
rootPatternsspecified for language server used for current buffer. -
"workspace.rootPatterns"settings, which default to[".git", ".hg", ".projections.json"].
The latter ones have lower priority. That is, they are only used when the previous patterns do not match a workspace folder.
Workspace-specific configuration file
The workspace coc-settings.json file can be created and opened with the :CocLocalConfig command, and its path is $(repo)/.vim/coc-settings.json.
Usage
- Find a references
- <Plug>
(coc-references)
Troubleshooting
Error on initialize: Error: EEXIST
[coc.nvim] error: Error on initialize: Error: EEXIST: file already exists, mkdir '/home/vim/.config/coc/extensions/.cache'
at Object.fs.mkdirSync (fs.js:885:18)
at new ExtensionManager (/home/vim/.local/share/nvim/plugged/coc.nvim/lib/model/extension.js:24:22)
at Extensions.init (/home/vim/.local/share/nvim/plugged/coc.nvim/lib/extensions.js:59:24)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
A Nodejs version of 10.14 or later fixes it.
error TS5058: The specified path does not exist: 'tsconfig.json'
error TS5058: The specified path does not exist: 'tsconfig.json'.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build" exited with 1.
error Command failed with exit code 1.
Use coc.vim from the Release branch.
javascript bundle not found, please compile typescript code
Use coc.vim from the Release branch. Then, after updating to the latest version, run :call coc#util#install().
javascript bundle not found, running :call coc#util#install()
Install yarn and run :call coc#util#install().
Can't create tmp file
???
coc.vim switched to custom popup menu - How to change the keymappings for <tab>
PR: https://github.com/neoclide/coc.nvim/pull/3862
See :h coc-completion or :h coc-completion-example for details.
In short, just replace it with the code from the Example vim configuration section on the homepage.
Launching server "languageserver.csharp-ls" using command csharp-ls failed
[coc.nvim] Server languageserver.csharp-ls failed to start: Error: Launching server "languageserver.csharp-ls" using command csharp-ls failed.
See the csharp-ls#Troubleshooting page. In short, you need to install csharp-ls.
=== The reference assemblies for .NETFramework,Version=v4.7.2 were not found ===
[coc.nvim] csharp-ls: msbuildWorkspace.Diagnostics: [Failure] Msbuild failed when processing the file '/home/user/Project/EduPiano/godot/EduPiano.csproj' with message: /usr/share/dotnet/sdk/7.0.202/Microsoft.Common.CurrentVersion.targets: (1229, 5): The reference assemblies for .NETFramework,Version=v4.7.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
See the dotnet#Troubleshooting page. In short, you need to install .NET Framework v4.7.2.
"openLocalConfig": Can't resolve workspace folder for current file
[coc.nvim] Error on notification "openLocalConfig": Can't resolve workspace folder for current file, consider create one of .git, .hg, .projections.json in your project root.
Error on notification "openLocalConfig": Can't resolve the workspace folder for the current file. Try creating one of .git, .hg, .projections.json in the project root.
UnhandledRejection: Cannot read properties of undefined (reading 'split')
[coc.nvim]: UnhandledRejection: Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
at Extensions4.runtimeExtensionStats (/home/zer0/.vim/bundle/coc.nvim/build/index.js:81886:33)
at Extensions4.init (/home/zer0/.vim/bundle/coc.nvim/build/index.js:81669:31)
at async Plugin.init (/home/zer0/.vim/bundle/coc.nvim/build/index.js:92432:9)
at async EventEmitter.<anonymous> (/home/zer0/.vim/bundle/coc.nvim/build/index.js:92538:13)
Press ENTER or type command to continue
If vim-spector is installed and the problem started right after installing a Gadget ... try removing the Gadget. It is most likely a Permission issue with the Gadget.
E605: Exception not caught: coc.nvim not ready when invoke CocAction "hasProvider"
Error detected while processing function ShowDocumentation[1]..CocAction[2]..function ShowDocumentation[1]..CocAction:
line 2:
E605: Exception not caught: coc.nvim not ready when invoke CocAction "hasProvider"
See the previous item (#UnhandledRejection: Cannot read properties of undefined (reading 'split')).
[coc.nvim] build/index.js not found, please install dependencies and compile coc.nvim by: npm ci
Go to the coc.nvim directory and build
cd ~/.vim/bundle/coc.nvim
# Node.js 버전 확인 (14.14+ 필요)
node --version
# 의존성 설치 및 빌드
npm ci
# 또는 yarn 사용 (더 빠름)
yarn install --frozen-lockfile
See also
Favorite site
- Github - coc.nvim
- Create coc.nvim extension to improve vim experience
- Let's use coc.nvim
- Setting up a NeoVim-based development environment - I decided to build a development environment using NeoVim and CoC.
- Building a python development environment with neovim and coc.nvim on MacOs10.14
- (vim) When coc-python's interpreter won't change