IDE for editing stan

Is there a standard editing tool for Stan ? What can I use and expect to work well with .stan files?

I use emacs generally but stan-mode does not seem to be aware of the latest cmdstan and I’m not sure how not to break my install when I update stan, with stan-mode.



Rstudio’s editor has proper syntax highlighting for Stan files.

@Bob_Carpenter uses emacs do may be able to comment on how to get it working.

1 Like

i’m using the highlighting and snippets in emacs. works like a charm


if using emacs, just install from melpa with package-install, no further setup is required.

also, there is a Jupyter notebook highlighting tool:


That seems to work for me too, do you have a workflow for compiling the files and applying the models to the data ? I tried using eshell within emacs but that doesnt sound optimal.

best guess would be to set the directory as /cmdstan when opening stan-mode. then make -f <current-buffer> ? Then not sure how to fit to the data ?

I’d like to this this all within emacs tbh, I’m interested in your workflow

I’m pretty unsophisticated with this, but if there is an emacs solution I would love to hear it! Also, I’ve been back and forth with interfaces for a while and am settling on cmdstanpy. I compile with cmdstanpy and run the model either in a notebook or script. The nice thing is that I can also do CmdStan directly with the compiled model for things like test grad etc.

Alright, I’ll look into it and come back here if to report if I find something good


I browse the web in emacs… if I can compile Stan models there… major props. But seriously check out the snippets. Its very nice for templating code.

Just chiming in to say that there’s also @eigenfoo’s stan-vim plugin for anyone using Vim:


Thanks for the mention @jonah!

Just wanted to say that in its test suite, stan-vim checks the source of the Stan documentation and makes sure that all functions are covered in the syntax files, so the package should stay pretty up-to-date with the language. It currently covers all functions in Stan 2.24.


stan-mode in emacs highlights for me

I use VS Code for just about everything and the extension
works pretty well and doesn’t make me leave my default text editor. It looks like it hasn’t been updated in a few years, though…
Has anyone tried to build a stan linter that can run in real time and ID errors in a model so you don’t have to get it from the compiler?