vim-conllu


Ⅰ. 插件描述

Some vim scripts for CONLL-U syntax highlighting and perhaps syntastic checking as well

Ⅱ. 基本信息

创建日期:  2019-02-18
使用用户:  1
Github星:  1
插件作者:  Flammie Pirinen

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/flammie/vim-conllu

Ⅳ. 文档说明

# vim-conllu

Some vim scripts for working with CONLL-U files, e.g. universal dependencies

  1. Works for version 2, as detailed in
    https://universaldependencies.org/format.html

Installation

Vundle should just work, add this to your plugins in .vimrc:

Plugin 'flammie/vim-conllu'

If you don't use Vundle, you can copy the files manually, e.g.:

cp plugin/conllu.vim ~/.vim/plugin/
cp syntax/conllu.vim ~/.vim/syntax/
mkdir -p ~/.vim/syntax_checkers/conllu
cp syntax_checkers/conllu/validate.vim ~/.vim/syntax_checkers/conllu/
mkdir -p ~/.vim/ale_linters/conllu
cp ale_linters/conllu/validate.vim ~/.vim/ale_linters/conllu/

Plugin

The plugin is just there to register filetypes and .conllu extension and etc.

Syntax highlighting

There's nothing really advanced here, I've just listed the known names and
values as keywords to be highlighted, so if I typo something it will be

  1. The syntax highlighter does not count columns or anything. It
  2. knows the special comment names and the format of index numbers also for

ellipses and multiwords.

Syntax checking

Syntax checking is done with validate.py from UD repo, to have it work you need to
go to https://github.com/universaldependencies/tools and get the validate.py.

ALE

There's an ALE plugin for automatic syntax

  1. It uses validate.py only at the moment. You need to set the following
  2. for it to work:
  • ale_conllu_validate_executable needs to point to validate.py
  • ale_conllu_validate_options needs to contain at least the lang option

E.g.:

let g:ale_conllu_validate_executable = $HOME . '/github/universaldependencies/tools/validate.py'
let g:ale_conllu_validate_options = '--lang olo'

Syntastic

There's a syntastic script that gets
registered as conllu/validate, you have to add it to syntastic registry to enable
automatic checking on write manually.

NB: the --lang en is hard-coded... not sure there's any easy way around it.
You need to copy validate.py into $PATH as conllu_validate.py. The syntastic
stuff has been replaced by ALE and is no longer developed.

添加新评论