Ⅰ. 插件描述
Document highlight and document colors support for coc.nvimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'neoclide/coc-highlight'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'neoclide/coc-highlight'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'neoclide/coc-highlight'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/neoclide/coc-highlight
Ⅳ. 文档说明
# coc-highlight
Provide default highlight for coc.nvim,
including document highlight (highlight of current document symbol) and colors
highlight.
Install
In your vim/neovim, run command:
:CocInstall coc-highlight
Features
- Highlight symbol of current position in all positions of current buffer (when no document
highlight provider exists from language server). - Highlight colors of current buffer (when no color provider exists from
language server).
Usage
To enable highlight current symbol on CursorHold
, add:
autocmd CursorHold * silent call CocActionAsync('highlight')
to your .vimrc
.
To disable coc provide color highlight, add:
"coc.preferences.colorSupport": false,
to your settings.json
.
To pick a different color, use command:
:call CocAction('pickColor')
Note: only works on Mac or have python gtk module installed.
To pick a different color presentation, use command:
:call CocAction('colorPresentation')
Options
highlight.disableLanguages
, list of filetypes to ignore for this extension.highlight.document.enable
, set tofalse
to disable document symbol
highlight.highlight.colors.enable
, set tofalse
to disable color highlight.
F.A.Q
Q: Why color highlight is not shown on my vim?
A: First, make sure "coc.preferences.colorSupport"
is not false
in yourcoc-settings.json
, then make sure you have set termguicolors
in your .vimrc
,
and your terminal support true color.
Q: How to change highlight of the current symbol.
A: All you need is overwrite the highlight group, checkout :h coc-highlights
License
MIT