gretl.vim (3730B)
1 " Vim syntax file 2 " Language: gretl (http://gretl.sf.net) 3 " Maintainer: Vaidotas Zemlys <zemlys@gmail.com> 4 " Last Change: 2006 Apr 30 5 " Filenames: *.inp *.gretl 6 " URL: http://uosis.mif.vu.lt/~zemlys/vim-syntax/gretl.vim 7 8 " quit when a syntax file was already loaded 9 if exists("b:current_syntax") 10 finish 11 endif 12 13 setlocal iskeyword=@,48-57,_,. 14 15 syn case match 16 17 " Constant 18 " string enclosed in double quotes 19 syn region gString start=/"/ skip=/\\\\\|\\"/ end=/"/ 20 " number with no fractional part or exponent 21 syn match gNumber /\d\+/ 22 " floating point number with integer and fractional parts and optional exponent 23 syn match gFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/ 24 " floating point number with no integer part and optional exponent 25 syn match gFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/ 26 " floating point number with no fractional part and optional exponent 27 syn match gFloat /\d\+[Ee][-+]\=\d\+/ 28 29 " Gretl commands 30 syn keyword gCommands add addobs addto adf append ar arch arma break boxplot chow coeffsum coint coint2 corc corr corrgm criteria critical cusum data delete diff else end endif endloop eqnprint equation estimate fcast fcasterr fit freq function funcerr garch genr gnuplot graph hausman hccm help hilu hsk hurst if import include info kpss label labels lad lags ldiff leverage lmtest logistic logit logs loop mahal meantest mle modeltab mpols multiply nls nulldata ols omit omitfrom open outfile panel pca pergm plot poisson pooled print printf probit pvalue pwe quit remember rename reset restrict rhodiff rmplot run runs scatters sdiff set setobs setmiss shell sim smpl spearman square store summary system tabprint testuhat tobit transpos tsls var varlist vartest vecm vif wls 31 32 "Gretl genr functions 33 syn keyword gGenrFunc log exp sin cos tan atan diff ldiff sdiff mean sd min max sort int ln coeff abs rho sqrt sum nobs firstobs lastobs normal uniform stderr cum missing ok misszero corr vcv var sst cov median zeromiss pvalue critical obsnum mpow dnorm cnorm gamma lngamma resample hpfilt bkfilt fracdiff varnum isvector islist nelem 34 35 " Identifier 36 " identifier with leading letter and optional following keyword characters 37 syn match gIdentifier /\a\k*/ 38 39 " Variable with leading $ 40 syn match gVariable /\$\k*/ 41 " Arrow 42 syn match gArrow /<-/ 43 44 " Special 45 syn match gDelimiter /[,;:]/ 46 47 " Error 48 syn region gRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError,gBCstart,gBCend 49 syn region gRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError 50 syn region gRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError 51 syn match gError /[)\]}]/ 52 syn match gBraceError /[)}]/ contained 53 syn match gCurlyError /[)\]]/ contained 54 syn match gParenError /[\]}]/ contained 55 56 " Comment 57 syn match gComment /#.*/ 58 syn match gBCstart /(\*/ 59 syn match gBCend /\*)/ 60 61 syn region gBlockComment matchgroup=gCommentStart start="(\*" end="\*)" 62 63 " Define the default highlighting. 64 " Only when an item doesn't have highlighting yet 65 hi def link gComment Comment 66 hi def link gCommentStart Comment 67 hi def link gBlockComment Comment 68 hi def link gString String 69 hi def link gNumber Number 70 hi def link gBoolean Boolean 71 hi def link gFloat Float 72 hi def link gCommands Repeat 73 hi def link gGenrFunc Type 74 hi def link gDelimiter Delimiter 75 hi def link gError Error 76 hi def link gBraceError Error 77 hi def link gCurlyError Error 78 hi def link gParenError Error 79 hi def link gIdentifier Normal 80 hi def link gVariable Identifier 81 hi def link gArrow Repeat 82 83 let b:current_syntax="gretl" 84 85 " vim: ts=8 sw=2