Ⅰ. 插件描述
Additional common sources of coc.nvimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'neoclide/coc-sources'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/neoclide/coc-sources
Ⅳ. 文档说明
# 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
completion.
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.
Configure
Following properties could be configured:
enable
set to false to disable source totally.priority
priority of source.shortcut
shortcut used inmenu
of completion item.filetypes
enabled filetypes, enable for all filetypes whennull
.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.
F.A.Q
Q: Omni completion not working.
A: Make sure current filetype is included in coc.source.omni.filetypes
section of yourcoc-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.
LICENSE
MIT