Plugin that adds support for Stata 11–15 for Sublime Text 2 and 3
This package adds basic support for Stata (11–15, Windows and OS X) and comes with:
.do
and .ado
filessuper+enter
ctrl+enter
This is a modified version of Steve Harris's Stata package. Because of scripting limitations in Stata < 12, his version relied on creating temporary .do
files to pass commands to Stata. Stata 13 added fancy new AppleScript commands (specifically DoCommand
and DoCommandAsync
) that allow for scripted commands and eliminate the need for temporary files. Because of that, this package is far simpler than other Sublime Text packages.
For compatability with previous versions of Stata, however, I have included commands that create temporary files, as in the original Stata package. As such, this package works with Stata 11 and above on both OS X and Windows.
There are two ways to install this package:
~/Library/Application Support/Sublime Text 2/Packages
or ~/Library/Application Support/Sublime Text 3/Packages
.do
files must be set to open in Stata by default in Finder (right click on a .do
file > "Get Info" > "Open with" > "Change all…" > Select Stata..do
files opened in Stata need to be run, not edited. Change this in Preferences > Do-file Editor > Advanced > Edit do-files opened from the Finder in Do-file Editor (uncheck this)By default, when sending code to Stata on OS X, Sublime Text will maintain focus so you can continue to edit, following the pattern of RStudio, which sends code to the R console from the script editor without changing focus away from the editor. If you prefer for Stata to take focus after sending lines or selections, set the switch_focus_to_stata
to true
in Stata Enhanced (OS X).sublime-settings
.
Stata Enhanced (Windows).sublime-settings
(default is "C:/Program Files (x86)/Stata13/StataSE-64.exe"
).do
files opened in Stata are run, not edited. Change this in Do-file Editor > Edit > Preferences > Advanced > Edit do-files opened from Windows instead of executing them (uncheck this)