Keyboard shortcuts for Stata/IC 13

Here is a consolidated list of keyboard shortcut commands for Stata, as well as some directions on how to form custom macro strings. I have formed this list from various Stata help files as well as my own trial and error:

Tab: completes a variable’s name in the command line sequence, as far as ambiguity allows (if there are similarly named variables)
Esc: clears the command sequence

Move cursor to various panes:
Ctrl+Tab: reverse cycles through the various panes
Ctrl+Shift+Tab: forward cycles through the various panes
Ctrl + 1: command pane
Ctrl + 2: output pane
Ctrl + 3: review log
Ctrl + 4: variable pane (also: pressing space bar whilst a variable is selected in the variable pane inserts this variable into the command line sequence)
Ctrl + 5: properties pane
Ctrl + 7: viewer window
Ctrl + 8: data window

Function keys:

F1: enters the command ‘help advice’
F2: enters the command ‘describe’
F3: opens up a ‘find’ tab in the output pane to search for specific text
F7: inserts the command ‘save’ into the command sequence
F8: inserts the command ‘use’ into the command sequence

Alt+F4: quits the program (I think this maybe a general windows command)

Customise function keys
Entering a command sequence of global F[number]commands assigns a function key to a command sequence such as “list;” (leave out the square brackets), with the semi-colon indicating entry of a command. This is a special form of global macro – see below.

Custom macros
Entering a command sequence of global [macro][commands] saves a sequence of words which you can later recall by prefix-ing the macro with $, that is $[macro]. You can get quite fancy with this it seems, so if interested read more in the pdf file “Programming Stata”: http://www.stata.com/manuals13/u18.pdf

________________

Coming from a background of using design software where shortcut usage is common, I find it surprising a command heavy program such as Stata doesn’t make keyboard shortcut information more readily accessible. Ideally, shortcut commands would be displayed when hovering a cursor over a menu command or displayed next to the command. Entry of these commands via shortcuts would still be recorded in the command log, so from a workflow perspective I can’t understand why this hasn’t been implemented in a mature program which many people use.

2 thoughts on “Keyboard shortcuts for Stata/IC 13”

  1. I am using stata for mac. I want to change the shortcut for execute (do) which is command+shift+D . I need it to be command+D like what we have in windows. I wasn’t able to find anything online. Any clue?

  2. Sorry, not sure! I actually do all coding (for Stata, and other languages) using notepad++ ; it’s a windows code editor, but there’s a thread of people trying to use it on macs here:
    https://notepad-plus-plus.org/community/topic/10880/alternative-for-notepad-on-mac

    If you manage to get it to work, there are some directions to getting it to sync in with stata (e.g. running selected lines by any shortcut of your choice) and do appropriate code highlighting here:
    https://huebler.blogspot.com.au/2008/04/stata.html

    good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *