Skip to content

ssp3nc3r/stan-syntax-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Stan syntax highlighting for vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published