andrewheiss / SublimeStataEnhanced

Plugin that adds support for Stata 11–15 for Sublime Text 2 and 3
56 stars 22 forks source link

Enhancement: Run current file using only one Stata command (Stata 13+) #29

Closed consideRatio closed 9 years ago

consideRatio commented 9 years ago

First of all, thank you for this plugin @andrewheiss, I had many issues with the Stata do-file editor and i love using Sublime!

WHAT I'd like: A shortcut to execute the Stata commando like this. do "/path-to-the-current/do-file.do"

WHY I'd like this: I am using StataMP 13, with Sublime text 3 as editor using your package. I'd like for some keyboard shortcut to run the currently active .do file in full so that Stata executes the code much quicker when I want to select everything and run the full file. I'd be fine by needing to save the file first as well.

USAGE: 1: First you either choose to save or not save your .do file open in Sublime 2: Then you press a shortcut defined by the StataEnhanced plugin that in turn runs the Stata command that in turn runs the current active .do file in Sublime; that is: do "path-to-the-current/do-file.do"

andrewheiss commented 9 years ago

This already exists in the build system. Just press ⌘ + B and the whole file will automatically be saved in ST and opened in Stata. As long as you have your Stata preferences set to run externally opened .do files (Preferences > Do-file editor > Advanced > Uncheck "Edit do-files opened from the Finder in Do-file Editor"), Stata will run the command do /path/to/file.do, as you expect.