4 [ U ] 10 Keyboard use
When we say press PrevLine, now you know what we mean: press PgUp or Ctrl+R. The editing
keys are the following:
Name for
editing key Editing key Function
Kill Esc on PCs and Ctrl+U Deletes the line and lets you start over.
Dbs Backspace on PCs and Backspace Backs up and deletes one character.
or Delete on other computers
Lft ←, 4 on the numeric keypad Moves the cursor left one character
for PCs, and Ctrl+H without deleting any characters.
Rgt →, 6 on the numeric keypad Moves the cursor forward one character.
for PCs, and Ctrl+L
Up ↑, 8 on the numeric keypad Moves the cursor up one physical line on a
for PCs, and Ctrl+O line that takes more than one physical line.
Also see PrevLine.
Dn ↓, 2 on the numeric keypad Moves the cursor down one physical line on a
for PCs, and Ctrl+N line that takes more than one physical line.
Also see NextLine.
PrevLine PgUp and Ctrl+R Retrieves a previously typed line. You may
press PrevLine multiple times to step back
through previous commands.
NextLine PgDn and Ctrl+B The inverse of PrevLine.
Seek Ctrl+Home on PCs and Ctrl+W Goes to the line number specified. Before
pressing Seek, type the line number. For
instance, typing 3 and then pressing Seek is
the same as pressing PrevLine three times.
Ins Ins and Ctrl+E Toggles insert mode. In insert mode, characters
typed are inserted at the position
of the cursor.
Del Del and Ctrl+D Deletes the character at the position of
the cursor.
Home Home and Ctrl+K Moves the cursor to the start of the line.
End End and Ctrl+P Moves the cursor to the end of the line.
Hack Ctrl+End on PCs, and Ctrl+X Hacks off the line at the cursor.
Tab →| on PCs, Tab, and Ctrl+I Expand variable name.
Btab |← on PCs, and Ctrl+G The inverse of Tab.
Example 1
It is difficult to demonstrate the use of editing keys on paper. You should try each of them.
Nevertheless, here is an example:
. summarize price waht
You typed summarize price waht and then pressed the Lft key (← key or Ctrl+H) three times
to maneuver the cursor back to the a of waht. If you were to press Enter right now, Stata would see
the command summarize price waht, so where the cursor is does not matter when you press Enter.
If you wanted to execute the command summarize price, you could back up one more character
and then press the Hack key. We will assume, however, that you meant to type weight.
If you were now to press the letter e on the keyboard, an e would appear on the screen to replace
the a, and the cursor would move under the character h. We now have weht. You press Ins, putting
Stata into insert mode, and press i and g. The line now says summarize price weight, which is