Skip to content

Instantly share code, notes, and snippets.

@felixjung
Created September 1, 2014 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixjung/6f0c03a808c1aa443bda to your computer and use it in GitHub Desktop.
Save felixjung/6f0c03a808c1aa443bda to your computer and use it in GitHub Desktop.
Adding languages to crags
# Definitions for R
--langdef=R
--langmap=r:.R.r
--regex-R=/^[ \t]*"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t]function/\1/f,Functions/
--regex-R=/^"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^f][^u][^n][^c][^t][^i][^o][^n]/\1/g,GlobalVars/
--regex-R=/[ \t]"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^f][^u][^n][^c][^t][^i][^o][^n]/\1/v,FunctionVariables/
# Definitions for UltiSnips
--langdef=snippets
--langmap=snippets:.snippets
--regex-snippets=/^snippet (.*)/\1/s,snippet/
# Markdown
--langdef=markdown
--langmap=markdown:.mkd
--regex-markdown=/^#[ \t]+(.*)/\1/h,Heading_L1/
--regex-markdown=/^##[ \t]+(.*)/\1/i,Heading_L2/
--regex-markdown=/^###[ \t]+(.*)/\1/k,Heading_L3/
# Makefile
--regex-make=/^\s*([^#][^:]*):/\1/t,target/
# Julia
--langdef=julia
--langmap=julia:.jl
--regex-julia=/^[ \t]*(function|macro|abstract|type|typealias|immutable)[ \t]+([^ \t({[]+}).*$/\2/f,function/
--regex-julia=/^[ \t]*(([^@#$ \t({[]+})|\(([^@#$ \t({[]+})\])|\((\$)\))[ \t]*(\{.*\})?[ \t]*\([^#]*\)[ \t]*=([^=].*$|$)/\2\3\4/f,function/]))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment