The ado-mode
is a major [editing] mode for Emacs which allows
truly good editing of Stata, namely do
, ado
,
sthlp
, smcl
, and mata
files.
Here is a screenshot to see what the
highlighting does.
The mode also handles indentation, date stamps, and includes templates for writing help files, project do-files and the like.
Emacs versions back to 25.1 are supported.
Here is the change log which says what is new.
The current version is 1.18.5.1, which is made for Stata 18.0. It works just fine with earlier versions of Stata, but it will highlight commands as though you were using Stata 18.0.
Here are the things which make life easier when using the ado-mode
.
ado-mode
can communicate well with Stata itself, sending
code directly to Stata for evaluation. This works macOS, and MS
Windows and Linux.if
,
foreach
, forvalues
, and while
blocks get closed. Many types of indentation styles are supported.smcl
directives are correctly highlighted, which
saves time when writing help files.M-x auto-complete-mode
or M-x company-mode
, among other minor modes. Both
highlight common words and words already used in the buffer being
edited. auto-complete-mode
comes with Emacs while
company-mode
can be downloaded from Melpa via M-x
list-packages
.The easiest way to install ado-mode
is to use the
package
package built into Emacs.
The package is hosted on MELPA
package manager site; here are the instructions for
getting started with MELPA.
If you want to tinker with it, you can grab it from github and fork away: https://github.com/louabill/ado-mode.
If you are unreasonably distrustful of package managers and github, and still believe in doing things the hard way, the zipped current version can be obtained by clicking here.
Bugs and requests can be put on github.
Anyways, here are the installation instructions.
Please let me know if there are any troubles with the installations, since there are little quirks with cross-platform Emacs stuff.
ado-mode
is on Twitter: @ado-mode
. The real reason for this is to have an easy RSS feed for finding out about updates: http://twitter.com/statuses/user_timeline/106578815.rss
If you are curious about Emacs, here is some more info. It is very dated, but it conveys the feeling well. If you are sold, and want to get a copy, here are more instructions.
If you are intrigued about using editors for editing Stata code in a nicer way than the built-in do-file editor works, try checking out the unofficial FAQ on text editors and Stata.