Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sublime Text and Stata 16

    I am trying to use Sublime Text with Stata 16, similar to what I previously did with earlier versions of Stata (versions 13 to 15). Unfortunately, with no success.

    I have tried two packages for Sublime Text 3 and Stata that might work on a Mac: Stata Enhanced and Stata Improved Editor. With both I get "No version of Stata found". Stata Enhanced seems to work only with Stata up to version 15, but the documentation (at packagecontrol.io) for Stata Improved Editor says it should work with Stata 16. (The documentation installed on the computer as part of the package does not mention Stata 16.)

    Has anyone been able to use Sublime Text with Stata 16? If so, I'd love to know how...

    Thanks,

    Christopher

    PS. I am able to run Stata from R, so Stata should be detectable.
    Last edited by Christopher Bratt; 07 Sep 2019, 11:18.

  • #2
    For anyone wanting to use Sublime Editor (SE) to develop do-files for Stata:

    Package Control for SE has the old version, not the version referred to on the package page. I wrote to the developer a while ago, today I received an answer:

    Thank you very much for the email. Sorry, my Stata account is expired a few days ago, I will figure out the issue as quick as I could and let you know.

    Many thanks,

    Best,
    Zizhong
    This developer makes Stata a big favour by coding a package that lets SE develop and send code to Stata. Maybe someone at Statacorp could give Zizhong a brief trial account to let him/her complete this valuable work?

    Zizhong can be contacted with this email address: [email protected]


    Christopher
    Last edited by Christopher Bratt; 12 Sep 2019, 01:43.

    Comment


    • #3
      In case anyone has been hoping for an update: Nothing so far.

      But there's an alternative.
      For those wanting to go beyond Stata's do-file editor (on a Mac) - you might try the free Visual Stata Code, developed by Microsoft. Packages for Stata language and sending commands to Stata are available.

      Comment


      • #4
        Hi Christopher,

        Any updates on this issue? I am stuck with the same problem and, like many around, I am a big fan of the Stata-Sublime Text combo. Hopefully, this issue gets fixed soon!

        P.S. I remember there was a way we could manually change the Stata version in the 'Settings - Default' of the Stata Improved Editor package. Or, may be, I am confusing with another package.

        Thanks,
        Apoorv

        Comment


        • #5
          @Arporv, sorry for not seeing this earlier. No, I don't know of any way around within Sublime Editor. Which is a pity. I'm currently using Visual Studio Code if coding for Stata, and I miss Sublime Editor.

          Strange to think of, there is an updated package out there, but it is not available because the developer no longer has the latest version of Stata and nobody seems interested in giving them a preliminary copy of Stata to complete this work.

          Comment


          • #6
            Sorry, I meant provisional access to Stata 16, for a few weeks.

            Comment


            • #7
              I would email StataCorp directly with this suggestion. If you want to contact me directly I can suggest a person to start with, but I don’t think it is a good idea to give their email address in public.

              Comment


              • #8
                I've got a package I developed for Sublime Text to integrate with Stata. It includes pretty good (IMHO) syntax highlighting rules, a modified Molokai color scheme that distinguishes regular from compound-double quoted text, and--most relevant here--simple integration with Stata, using hotkeys to run the current file, run the highlighted portion of the current file, expand the highlighting up and down to the first blank lines and run that.

                I aspire to put it out into the world as a Sublime Text package, but probably won't have the time any time soon to do so. I'm happy to share it with anyone who contacts me directly, however.

                Comment


                • #9
                  I was able to get Sublime Text 3 to work with Stata SE 16 by reinstalling the Stata Improved Editor package. Go to https://packagecontrol.io/packages/S...roved%20Editor and follow the manual installation instructions. I replaced my older Stata Improved Editor package file with the newly downloaded ones and it works!

                  Comment


                  • #10
                    I'd like to confirm that it works, as described by Ivy Chen (I just tried). Thank you.

                    For those using Stata's do-editor and wondering why people use anything else: Several commercial or free text editors provide features that are not available in Stata's do-file editor. The most important one may be multiple cursors. If you're on a Mac, I'd recommend trying Sublime Text or Visual Studio Code (that latter is from Microsoft and free).

                    Thanks also to Nicholas Winter for developing a Stata package for Sublime Text. Good luck!

                    Comment


                    • #11
                      If "multiple cursors" is referring to the ability to edit multiple columns at once, it's available since Stata 15, see the FAQ for details. https://www.stata.com/support/faqs/d...o-file-editor/

                      P.S. I am not trying to persuade anyone switching to anything. I understand the choice of the text editor is a highly personalized matter, like your favorite hammer or kitchen knife.

                      Comment


                      • #12
                        One additional feature that I just discovered for myself is that (in Windows), holding control and clicking with my mouse allows me to the place the cursor in multiple locations (or make multiple selections) which is different behaviour than column-mode selection.

                        Comment


                        • #13
                          Thanks for the comment. The term multiple cursors refers to beeing able to have several cursors within a single file, no limits to where or how many. Practical implications are for instance to edit multiple rows at once and add identical text to each row simultaniously or to edit all (or some) occurences of a specific word/command wherever they are in the file.

                          Another issue for me with the current do-file editor, is how the do-file editor handles brackets and quotations marks. If you select a word or a section and hit brackets, all text is gone, rather than the text in quesiton being put in brackets. In principle, this can be solved by the user by developing a tiny program (macro, but not in the Stata meaning of that term). Most limitations in the do-file editor can be solved by using some macro sofware. But multiple cursors is different.

                          That said, I find the latest do-file editor much improved!

                          Comment


                          • #14
                            Thanks for the suggestions, I will think about the disjoint cursor and brackets and quotations marks when there is a selection.

                            Comment


                            • #15
                              @Leanardo. Yes, you're right! That's an example.

                              Can you do that with keyboard commands? I do the following Command-Shift-ArrowDown adds a cursor below. Command-Shift-ArrowUp adds a cursor above.

                              And Command-D selects the next occurance of the current word or text that is identical to the current selection, it can be anywhere in the file. (Command-U unselects the last selection).
                              Command-Ctrl-G selects all occurences of that word/text.
                              And then I can start writing, correcting all those occurences of the word/command/text.

                              Comment

                              Working...
                              X