Java Lab Documentation

Mac: Basic Commands

Category:Java Lab Shortcuts

Examples

Select All Text

cmd + a

selects all text in a file

Copy Selected Text

cmd + c

copies the selected text

Cut Selected Text

cmd + x

cuts the selected text

Paste Selected Text

cmd + v

pastes the selected text

Undo the Last Change

cmd + z

undo the last change

Open the Find/Replace Window

cmd + f

opens the find/replace window

To close the find/replace window, click Esc or the small x in the top-right corner.

Move Cursor Left, Right, Up, or Down

Arrow Left/Right/Up/Down

moves the cursor left, right, up, or down

Move to the Top or Bottom of a File

cmd + Arrow Up/Down

goes to the top or bottom of a file

Insert a New Line and Indent

Enter

inserts a new line and indents

Insert Two Spaces

Tab

inserts two spaces

Delete the Line Before the Cursor

cmd + Backspace

deletes the line before the cursor

Delete the Line After the Cursor

Ctrl + Delete

deletes the line after the cursor

Comment Out Selection or Line

cmd + /

comments out the current selection or the current line if no selection

Decrease Indent

cmd + [

decrease indent

Increase Indent

cmd + ]

increase indent

Go to Matching Bracket

Shift + cmd + \

go to the matching bracket (only when on a bracket)