Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command line editor that highlights the Stata syntax? [closed]

My internet connection is extremely slow and therefore I execute batch files on the server without GUI, i.e. directly from the terminal. However, oftentimes I need to make a few changes in the code and a text editor highlighting Stata syntax would not hurt. Is there one?

like image 991
P.Escondido Avatar asked Aug 21 '13 15:08

P.Escondido


2 Answers

Sublime Text editor has a package for Stata. If you're using mac you can find installation instructions here.

like image 126
Nir Alfasi Avatar answered Sep 28 '22 15:09

Nir Alfasi


As linked by Maarten Buis, Nick Cox's list is the reference. It's a cool list, but it's badly outdated and therefore misses out the best parts of Stata support on Mac OS X. Here are some additions that also allude to the other answers.

Mac

TextMate has two Stata bundles, the Beatty bundle and the more recent Schumm bundle that uses a smarter approach to Stata syntax. (Note: not sure whether the Beatty bundle works under Stata 13; the Schumm bundle, which is the one you get through TextMate's bundle settings, does.)

Two other editors, Chocolat and Sublime Text, support TextMate bundles or ports of TextMate bundles. Phil Schumm's Stata bundle for TextMate is the most advanced and up-to-date solution that I know of, so I'd recommend that if you need an external editor.

TextWrangler also supports Stata through its own plugin system. I guess that BBEdit might therefore support it too, probably through slightly more awkward AppleScript calls. The only reason I see to use these instead of TextMate is if you are running an old system and/or are using these editors already.

If you need more alternatives, check out websites like Alternative To, I Use This, MacUpdate or VersionTracker for a larger choice of options. You'll find out that SubEthaEdit and Smultron (and probably its deceased fork, Fraise) support Stata, for instance.

tl;dr On Mac OS X, use TextMate with the Schumm bundle, and you will like it. (No idea if you can create GitHub issues through email, though!)

Win

Notepad++ has support, and there are mentions on Statalist of PFE, UltraEdit and WinEdt also having support. My guess is that you will find it more useful to get Sublime Text and use its Stata bundle port, unless again you are already using these editors.

tl;dr On both Mac OS X and Windows, Sublime Text with the Stata TextMate bundle port seem to work well.


As mentioned in another answer, Vim also offers support, and Emacs has an ado major mode, plus some additional functions through ESS (Emacs Speaks Statistics). Finally, if you are looking a Java cross-platform solution (but why would you?), jEdit supports Stata syntax.

If you want support for Stata colored syntax everywhere (e.g. on GitHub), you'll need to write a lexer for Stata and submit it to Pygments. I've asked a question about that. It does not look very difficult if you know enough Python (which I do not and regret).

HTH

Added: links, sections.

like image 43
Fr. Avatar answered Sep 28 '22 17:09

Fr.