tigris.nvim


Ⅰ. 插件描述

A semantic javascript syntax highlighter (uses babylon) for Neovim

Ⅱ. 基本信息

创建日期:  2016-08-01
使用用户:  4
Github星:  74
插件作者:  Billy Vong

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'billyvg/tigris-nvim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'billyvg/tigris-nvim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'billyvg/tigris-nvim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/billyvg/tigris.nvim

Ⅳ. 文档说明

# tigris.nvim (alpha) Build Status

tigris is a NodeJS remote plugin for Neovim that provides async syntax highlighting for
javascript (using babylon).

This project is largely inspired by chromatica, which in turn is largely inspired by
deoplete and color_coded.

Features

  • Accurate highlighting for modern javascript (ES6, flowtype, JSX)

Comparison

Prerequisites

Tested on:

* macOS 10.11.6, Neovim 0.1.5, Node.js 6.3.1

Installation

Install Vim Plugins

Use a plugin manager (vim-plug, Neobundle, dein, etc). neovim/node-host requires running npm install.
You may need to run install.sh in tigris.nvim as well.

vim-plug

Plug 'neovim/node-host', { 'do': 'npm install' }
Plug 'billyvg/tigris.nvim', { 'do': './install.sh' }

dein

call dein#add('neovim/node-host', { 'build': 'npm install' })
call dein#add('billyvg/tigris.nvim', { 'build': './install.sh' })

Or manually check out the repo and put the directory to your vim runtime path.

Updating

Update plugins via git or plugin manager (i.e. with vim-plug: :PlugUpdate). Then :UpdateRemotePlugins and finally restart Neovim.

How to use

You can use the :TigrisStart (as well as :TigrisToggle) command to parse your document once, and :TigrisStop to clear highlighting and disable parsing.

You can configure the parser to run at startup by

let g:tigris#enabled = 1

Debugging

:TigrisDebug will give you information about what highlighting groups your current cursor position is in. You must have debug mode turned on first. You can then use these groups for your own highlighting.

let g:tigris#debug = 1

On the fly highlighting

By default the plugin works as you change the buffer in Insert mode. Parsing is debounced with a 500ms delay (i.e. at most,
the parser will only run once every 500ms). You can change this delay or disable this completely. When disabled, the
parser will run when you enter a buffer or leave Insert mode.

let g:tigris#on_the_fly_enabled = 1
let g:tigris#delay = 500

Note that this may slowdown your system (especially with larger files) since it can potentially
be traversing the AST every 500ms.

Known Issues

Missing/incorrect highlights

Please open an issue as this project is still young and there are many things still missing/incorrect.

Performance

This can be SLOW. Early measurements are around 400ms for 500 LoC on a 2015 MBP. I'm aiming for accuracy and completeness
before performance.

添加新评论