Version 1.1.0 includes the ability to run code in a session of Stata running on a remote server. See the configuration settings below for details.
In the terminal run
apm install stata-exec or go to Settings > Install and search for
stata-exec. This package depends on
language-stata, which you will be prompted to install if needed.
Code can be run using either the Command Palette or with keyboard shortcuts. Important: You must first select the flavor of Stata you own. See configuration settings below.
To open the Command Palette, press
cmd-shift-P, and then start typing
Stata Exec. The available commands will be shown in the drop-down menu.
The following are the default keyboard shortcuts. These can be personalized in your
cmd-enter: send selection or current line to Stata.
shift-cmd-d: send entire file to Stata. (File must be saved first. This runs
shift-alt-p: send the previous command.
shift-cmd-c: change Stata's working directory to that of current file.
shift-cmd-g: send paragraph under current cursor. A paragraph is a region enclosed by whitespace.
shift-cmd-r: send program definition under current cursor. If there exists
program drop on the line before
program define, the line including the former will be included in the selection. For example, all the lines in the below snippet would be sent to Stata:
cap program drop myProgramprogram define myProgram// program contentsend
All configuration can be done in the settings panel (Settings > Packages > stata-exec). The available options are listed below:
ssh username@host -Y, likely followed by
xstata. This package's commands to run the entire do file and set the working directory are not supported on XQuartz.
This package is currently Mac-only. I hope to add Windows support, but need to figure out some Visual Basic or VBScript first. Linux users can use stata-autokey to run selections in a GUI session of Stata.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.