vim-rebol


Ⅰ. 插件描述

REBOL 3 syntax highlighting

Ⅱ. 基本信息

创建日期:  2014-10-07
使用用户:  1
Github星:  3
插件作者:  Prosumma

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Syntax Highlighting For REBOL (3) in Vim

I'm going to assume that anyone needing REBOL syntax highlighting for Vim is already aware that REBOL is a homoiconic language. Most syntax highlighting I've seen for REBOL downplays its homoiconicity, treating it as if the DO dialect were paramount. I wanted to strike a balance between the DO dialect and plain homoiconicity, and I think I've hit on it.

What this means is that I don't highlight a token based on whether the DO dialect predefines it as a function or some other data type. Rather, I highlight it based on its homoiconic data type and whether or not it is predefined. E.g., X is a WORD!, but it is not predefined. DO is also a WORD! and it is predefined. Each will get different highlighting.

There are some exceptions. There's a convention in REBOL that data types end with an exclamation point. Any word ending in an exclamation point will be highlighted as a datatype, whether predefined or not. Also, the tokens REBOL, SELF, YES, NO, ON, OFF, TRUE, FALSE, and /LOCAL get special emphasis.

There are alse some compromises. REBOL allows some pretty complex path expressions, e.g.

foo/:x/(2 + 3): 7

What to do with this? My solution isn't perfect, but try it out and see. :)

This is a work in progress, but it is mostly complete with few problems. There is a bug with / used as an operator and I still have to finish proper highlighting of non-integral numbers, dates, issues, and a few other types. Complex paths such as those mentioned above may need a few tweaks, though they work pretty well.

Lastly, the ftdetect plugin in this bundle assumes the use of the .reb extension rather than .r as suggested by Carl Sassenrath (http://www.rebol.com/cgi-bin/blog.r?view=0540). I use this for everything I do. (Most of what I write is R3, not R2.)

添加新评论