Skip to main content

Stata shortcuts

Your answer helps keep this page right.

Do these shortcuts work for you?

Previous Command, Next Command, Clear Command and Autocomplete are four of the five Command Window shortcuts in the Stata list. Do-file Editor has Execute Selection/File, and also Toggle Comment, Go to Line, Increase Indent and Decrease Indent. General has Focus Results, Print and Close Window.

SetappAd
A shortcut to the best Mac apps

An essential toolbox for macOS and iOS.

Start with these

  • Execute Selection/File
  • Previous Command
  • Next Command
  • Focus Command Window
  • Toggle Comment
  • New Variable

Tips for Stata

  • Focus Command Window ⌘1 and Focus Results ⌘2 use the first two number keys with the same modifier.
  • Decrease Indent ⇧⌘I uses the keys of Increase Indent ⌘I plus Shift.
  • Clear Command Esc and Autocomplete Tab need no modifier.
Jump to section

Command Window5

ActionShortcut
Previous Command
Next Command
Clear Command
Autocomplete
Focus Command Window

Do-file Editor8

ActionShortcut
Execute Selection/File
Save
Find
Find Next
Go to Line
Toggle Comment
Increase Indent
Decrease Indent

Data Editor4

ActionShortcut
New Variable
Copy
Paste
Find in Data

General3

ActionShortcut
Focus Results
Print
Close Window
Report a problem

GitHub is public. Email is private.

Frequently Asked Questions

How many keyboard shortcuts does Stata have on macOS?

Stata has 20 keyboard shortcuts on macOS, organized into 4 sections: Command Window, Do-file Editor, Data Editor, General. This page lists all of them with searchable, organized shortcut tables.

Which Stata shortcuts should I learn first?

Start with Execute Selection/File (⇧⌘D), Previous Command (⌘↑), Next Command (⌘↓), Focus Command Window (⌘1), Toggle Comment (⌘/), New Variable (⌘N). The sections on this page list the rest.

Can I download Stata shortcuts as a PDF?

Yes. Click the download button at the top of this page to generate a printable PDF cheat sheet with all 20 Stata shortcuts. The PDF includes organized sections, keycap-style key labels, and space for your own notes.

Where is the official Stata keyboard shortcuts documentation?

The official Stata keyboard shortcuts documentation is available on their website. Every shortcut on this page is sourced from and verified against the official documentation to ensure accuracy.

Do these Stata shortcuts work on all Mac keyboards?

Yes. These shortcuts work on all Mac keyboards, including MacBook built-in keyboards and external Apple keyboards. The modifier keys are Command (⌘), Option (⌥), Control (⌃), and Shift (⇧). On keyboards without a Function row, some F-key shortcuts may require holding the Fn key.

Maintained by

Access Stata shortcuts from your menu bar

KeyShortcut detects the active app and shows its shortcuts instantly. Switch it on in Settings. No memorization needed.