dc.vim


Ⅰ. 插件描述

syntax definitions for dc (desktop calculator)

Ⅱ. 基本信息

创建日期:  2010-05-04
使用用户:  1
Github星:  1
插件作者:  bri hefele

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Syntax definitions file for dc (desktop calculator).

Catch a glimpse of it at http://brhefele.brainaxle.com/misc/dc.html - note this html file was generated using vim's export highlighted as html tool.

Important note: this was written to support the way I code dc. The big problem with highlighting dc (IMO) is that of macros. Macros are stored in strings, with no clear way to delineate what a string may or may not be used for later on. Or, at least, no prescribed way. So, I need to prescribe my own way. Basically, everything inside […] is interpreted as a string, unless the string is followed by an execute command (x) OR a save command and a newline (s.n). This allows me to use macros as functions, and for the sake of tidiness, I keep all functions on their own lines. I assume, then, that a […]sx in the middle of the line is just a string being saved for later. I make a lot of assumptions. And I may change this later to allow for some variables to be set depending on a user's usage. For instance, I also set load/save register operations to a specific highlight. But if you load a register to execute, including as part of a conditional, the whole operation changes to a different highlight (that for execute).

So again, this won't work for everyone. It might not work for anyone except me, really, since who uses dc these days anyway? But if you have any issues, suggestions, I welcome any and all emails on the subject.

添加新评论