Ⅰ. 插件描述
Asynchronous syntax highlight engine for NeovimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'keitanakamura/highlighter-nvim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'keitanakamura/highlighter-nvim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'keitanakamura/highlighter-nvim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/keitanakamura/highlighter.nvim
Ⅳ. 文档说明
# highlighter.nvim
Highlighter is an asynchronous syntax highlight engine (using ctags) for Neovim.
Features
- The highlighter plug-in is based on Exuberant Ctags that generates an index (or tag) file of language objects found in source files. This means that the highlighter is available for all of languages supported by ctags.
- Tag data and syntax commands (for vim) are generated asynchronously by using python-client.

Reguirements
- Neovim with if_python3.
- Exuberant Ctags.
Installation
For vim-plug
Plug 'KeitaNakamura/highlighter.nvim', { 'do': ':UpdateRemotePlugins' }Usage
You can update the syntax highlight by using :HighlighterUpdate command.
Options
Languages that you want to disable syntax highlight
example:
let g:highlighter#disabled_languages = ['c', 'cpp'] " set `filetype`sAutomatic syntax highlight
let g:highlighter#auto_update = 0 " 0: disable (default), 1: after saving the file, 2: after saving and opening the fileProject root directory sign
Syntax highlight is updated only in the current file by default. If you add g:highlighter#project_root_signs option, the highlighter set a directory having a root sign as project root, and all of your project files (same language) will be updated.
example:
let g:highlighter#project_root_signs = ['.git']Customization
example:
let g:highlighter#syntax_python = [
\ { 'hlgroup' : 'HighlighterPythonFunction',
\ 'hlgroup_link' : 'Function',
\ 'tagkinds' : 'f',
\ 'syntax_type' : 'match',
\ 'syntax_suffix' : '(\@=',
\ },
\ { 'hlgroup' : 'HighlighterPythonMethod',
\ 'hlgroup_link' : 'Function',
\ 'tagkinds' : 'm',
\ 'syntax_type' : 'match',
\ 'syntax_prefix' : '\.\@<=',
\ },
\ { 'hlgroup' : 'HighlighterPythonClass',
\ 'hlgroup_link' : 'Type',
\ 'tagkinds' : 'c',
\ }]hlgroup: Highlight group (required)hlgroup_link: If it is set,highlight linkcommand will be executed.tagkinds: Seectags --helpin terminal for details. (required)syntax_type:keyword(default) ormatch. See:h syn_keywordand:h syn_matchfor details.syntax_prefix: This is used only formatchsyntax type.syntax_suffix: This is used only formatchsyntax type.
I added above customizations for following languages, referring to xolox/vim-easytags.
- Lua
- C
- C++
- PHP
- Python
- Java
- C#
- Ruby
- Perl
- Julia
Please see 'Setting for each language' section in autoload/highlighter.vim for details.