Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions syntax/stata.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
" Language: Stata and/or Mata
" Maintainer: Chris Poliquin <chrispoliquin@gmail.com>
" Note: Based on the original by Jeff Pitblado <jpitblado@stata.com>
" Last Change: 2022-04-25
" Version: 0.6.36
" Last Change: 2025-12-10
" Version: 0.6.40


" Preamble {{{
Expand Down Expand Up @@ -123,8 +123,10 @@ syn keyword stataCommand class
syn keyword stataCommand classutil
syn keyword stataCommand clear
syn keyword stataCommand cloglog
syn keyword stataCommand clonevar
syn keyword stataCommand codebook
syn keyword stataCommand collapse
syn keyword stataCommand collect
syn keyword stataCommand corr[elate]
syn keyword stataCommand compress
syn keyword stataCommand contrast
Expand Down Expand Up @@ -163,6 +165,7 @@ syn keyword stataCommand erase
syn keyword stataCommand eret[urn]
syn keyword stataCommand err[or]
syn keyword stataCommand estadd
syn keyword stataCommand estat
syn keyword stataCommand etable
syn match stataCommand '\<estat \(ic\|summarize\|vce\|gof\)\>'
syn match stataCommand '\<est\(imates\)\? \(save\|use\|esample\|tab\(le\)\?\|sto\(re\)\?\|res\(tore\)\?\|q\(uery\)\?\|des\(cribe\)\?\|drop\|dir\|clear\)\>'
Expand Down Expand Up @@ -193,8 +196,12 @@ syn keyword stataCommand graph
syn keyword stataCommand gsort
syn keyword stataCommand hausman
syn keyword stataCommand help
syn keyword stataCommand heckman
syn keyword stataCommand heckoprobit
syn keyword stataCommand heckpoisson
syn keyword stataCommand heckprobit
syn keyword stataCommand hexdump
syn keyword stataCommand hist
syn keyword stataCommand hist[ogram]
syn keyword stataCommand hotelling
syn keyword stataCommand icd9[p]
syn keyword stataCommand icd10
Expand All @@ -205,6 +212,7 @@ syn keyword stataCommand infix
syn keyword stataCommand input
syn keyword stataCommand insheet
syn keyword stataCommand inspect
syn keyword stataCommand ipolate
syn keyword stataCommand iqreg
syn keyword stataCommand isid
syn keyword stataCommand ivreg[ress]
Expand Down Expand Up @@ -415,6 +423,7 @@ syn keyword stataCommand xtline
syn keyword stataCommand xtlogit
syn keyword stataCommand xthtaylor
syn keyword stataCommand xtintreg
syn keyword stataCommand xtheckman
syn keyword stataCommand xtmelogit
syn keyword stataCommand xtmepoisson
syn keyword stataCommand xtnbreg
Expand Down Expand Up @@ -443,6 +452,8 @@ syn keyword stataCommand zipfile
syn keyword stataCommand asdoc
syn keyword stataCommand astile
syn keyword stataCommand collin
syn keyword stataCommand did2s
syn keyword stataCommand did_imputation
syn keyword stataCommand distinct
syn keyword stataCommand eglist
syn keyword stataCommand estout
Expand Down Expand Up @@ -479,6 +490,7 @@ syn keyword stataCommand ivreg29
syn keyword stataCommand ivreg210
syn keyword stataCommand ivreghdfe
syn keyword stataCommand jarowinkler
syn keyword stataCommand jwdid
syn keyword stataCommand keeporder
syn keyword stataCommand kountry
syn keyword stataCommand labcd
Expand All @@ -494,6 +506,7 @@ syn keyword stataCommand labvarch
syn keyword stataCommand labvalclone
syn keyword stataCommand labvalcombine
syn keyword stataCommand mdesc
syn keyword stataCommand mipolate
syn keyword stataCommand missings
syn keyword stataCommand outreg[2]
syn keyword stataCommand ppmlhdfe
Expand Down Expand Up @@ -1060,12 +1073,12 @@ syn region stataFunc matchgroup=Function start=/\<vecdiag(/ end=/)/ contains=@st
" Numbers {{{
" -----------------------------------------------------------------------------
" (patterns from github.com/zizhongyan/stata-vim-syntax)
syn match stataNumber "\<\d\>" display
syn match stataNumber "\<[0-9]\d\+\>" display
syn match stataNumber "\<\d\+[jJ]\>" display
syn match stataFloat "\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
syn match stataFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
syn match stataFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
syn match stataNumber "\<-\?\d\>" display
syn match stataNumber "\<-\?[0-9]\d\+\>" display
syn match stataNumber "\<-\?\d\+[jJ]\>" display
syn match stataFloat "-\?\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
syn match stataFloat "\<-\?\d\+[eE][+-]\=\d\+[jJ]\=\>" display
syn match stataFloat "\<-\?\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
syn match stataBinNumber "\<0[bB][01]\+[lL]\=\>" display
syn match stataBinNumber "\<0[bB][01]\+\>" display
syn match stataHexNumber "\<0[xX]\x\+[lL]\=\>" display
Expand Down