stan-syntax-vim


Ⅰ. 插件描述

Stan syntax highlighting for vim

Ⅱ. 基本信息

创建日期:  2017-09-06
使用用户:  1
Github星:  1
插件作者:  ssp3nc3r

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# stan-syntax-vim
Stan syntax highlighting for vim

To set this up for vim,

  1. create .vim directory in home directory(~), and within that diretory, create three other directories: colors, ftdetect, and syntax.
  2. Add the files provided herein.

The Stan names of functions, distributions and such identified in the syntax file for vim were pulled from RStan version 2.16.2 using rstan::lookup() in R as follows:

d <- c(rstan::lookup("_lpmf$")$StanFunction, sub("_lpmf", "", rstan::lookup("_lpmf$")$StanFunction),
          rstan::lookup("_lpdf$")$StanFunction, sub("_lpdf", "", rstan::lookup("_lpdf$")$StanFunction),
          rstan::lookup("_lcdf$")$StanFunction, sub("_lcdf", "", rstan::lookup("_lcdf$")$StanFunction),
          rstan::lookup("_lccdf$")$StanFunction, sub("_lccdf", "", rstan::lookup("_lccdf$")$StanFunction),
          rstan::lookup("_cdf$")$StanFunction, sub("_cdf", "", rstan::lookup("_cdf$")$StanFunction),
          rstan::lookup("_rng$")$StanFunction, sub("_rng", "", rstan::lookup("_rng$")$StanFunction))

d <- unique(d)

f <- rstan::lookup("[:alnum:]*")$StanFunction

f <- unique(f)

f <- f[-grep("operator", f)]

f <- f[!(f %in% d)]

The other keywords were gathered from the Stan Manual.

添加新评论