Ⅰ. 插件描述

Additional common sources of coc.nvim

Ⅱ. 基本信息

创建日期:  2018-11-22
使用用户:  8
Github星:  81
插件作者:  neoclide

Ⅲ. 安装方法


Plugin 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。


NeoBundle 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %


Plug 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %


cd ~/.vim/bundle
git clone

Ⅳ. 文档说明

# coc-sources

Some extra completion sources of coc.nvim.

Install what you need by command :CocInstall {name}

  • coc-dictionary

Words from files in &dictionary.

:CocInstall coc-dictionary
  • coc-tag

Words from tagfiles()

:CocInstall coc-tag

Note: you need generate the tag files yourself.

To get the tags of current buffer, use command :echo tagfiles().

  • coc-word

Words from google 10000 english repo.

:CocInstall coc-word
  • coc-emoji

Emoji words, default enabled for markdown file only.

:CocInstall coc-emoji

To complete emoji source, type : as trigger character.

It is also possible to change the emoji trigger character by putting
"coc.source.emoji.triggerCharacters": ["TRIGGERCHAR"] in your coc-settings.json

  • coc-omni

Completion use &omnifunc of current buffer.

:CocInstall coc-omni

Note: Using omni completion in coc.nvim is not recommended, it will block vim on

Note: You must configure coc.source.omni.filetypes with filetypes you want omni
source to work.

Don't enable this source for filetypes that you're using language server
for completion.

  • coc-syntax

Words from syntax list, see :help ft-syntax-omni in your vim.

:CocInstall coc-syntax
  • coc-gocode

Completion use gocode for golang.

:CocInstall coc-gocode
  • coc-ultisnips

Completion for items from ultisnips

:CocInstall coc-ultisnips

Important: this source could be block and not work when ultisnips plugin not loaded in vim.

  • coc-neosnippet

Completion for items from neosnippet

:CocInstall coc-neosnippet

Important: this source could be block and not work when neosnippet plugin not loaded in vim.


Following properties could be configured:

  • enable set to false to disable source totally.
  • priority priority of source.
  • shortcut shortcut used in menu of completion item.
  • filetypes enabled filetypes, enable for all filetypes when null.
  • disableSyntaxes syntax names used to disable completion, ex: ['string', 'comment'].

Install coc-json by :CocInstall coc-json and Type coc.source settings file
opened by :CocConfig to get completion for all available configurations.


Q: Omni completion not working.

A: Make sure current filetype is included in coc.source.omni.filetypes section of your
coc-settings.json, then make sure omnifunc is specified for current buffer
by command: :echo &omnifunc.

Q: Completion items of Ultisnips/neosnippet not shown.

A: It won't work when your ultisnips or neosnippet plugin not loaded. For
better experience, consider use coc-snippets instead.