Announcement

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

  • Auto complete command

    Hello all,

    I'm a newbie of Stata and I would like to know whether Stata supports auto complete command mode or not? I tried searching before asking but unfortunately, I don't find the answer for this issue.
    To make clear my question, I give an example as below.

    Ex: On command window, in case I want to type "xtreg" but when I only type "xtr", is there any way to autocomplete this command from Stata? (Could we press Ctrl+Tab or something like that and Stata give us some choices?)

    Thanks for your help so much.

    Best Regards,
    Khoa Nguyen

  • #2
    You can use TAB to complete variable names, if not ambiguous.
    You should:

    1. Read the FAQ carefully.

    2. "Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!"

    3. Describe your dataset. Use list to list data when you are doing so. Use input to type in your own dataset fragment that others can experiment with.

    4. Use the advanced editing options to appropriately format quotes, data, code and Stata output. The advanced options can be toggled on/off using the A button in the top right corner of the text editor.

    Comment


    • #3
      Thanks Roberto for your quick reply. So about the command, could we use TAB also? For example, when I type "xtre" and TAB => xtreg.

      Comment


      • #4
        If there's a way, I don't know about it.
        You should:

        1. Read the FAQ carefully.

        2. "Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!"

        3. Describe your dataset. Use list to list data when you are doing so. Use input to type in your own dataset fragment that others can experiment with.

        4. Use the advanced editing options to appropriately format quotes, data, code and Stata output. The advanced options can be toggled on/off using the A button in the top right corner of the text editor.

        Comment


        • #5
          No, there is no intellisense in Stata, if this is what you wish for.
          If a command can be guessed from an abbreviated form, there is also a chance you can keep it in the abbreviated form, for example
          Code:
          gen x=1
          where gen is a short form for generate.

          Stata's editor is not user-extensible, so users can't contribute into enriching it's features. Other editors, especially with custom programmable syntax highlighting can be customized to support something like this.

          Best, Sergiy Radyakin

          Comment


          • #6
            Hi all,

            Thank you for your information so much.

            Best Regards,
            Khoa Nguyen

            Comment


            • #7
              As far as I know there is no autocomplete command.
              However if you're a fan of shortcuts, the minimal letters to call a command (or an option) are detailed in help files (underlined characters).
              example for the generate , g varname=exp is enough instead of generate varname=exp ; (or su x1,de for summarize x1, details)

              However, the xtreg command doesn't indicate any abbreviation.

              Comment


              • #8
                You might want to take a look at programs like TextExpander. It's an OS-wide tool for inserting (even large chunks) of text. It works in all programs, including Stata do-files, LaTeX etc. It also accepts macros (e.g. like in OSX %B %e, %Y for date format). I used it initially as a speed up for emails, word docs, agenda etc. but you can simply generate custom templates for e.g. histograms using a simple command like ;hist.

                Comment

                Working...
                X