Russell Gordon

Search CTRL + K

Keyboard Shortcuts in Playgrounds

Keyboard shortcuts let us reduce the amount of time we spend reaching for the trackpad or a mouse.

Learn the shortcuts below and gain one of the small but helpful "super powers" of experienced software developers.

Run Playground

Run the latest version of your code.

Shortcut: Command-R

Pressing Command-R runs the latest version of the code shown in a Playground.

Step Through My Code

Step through your code, showing what line is being run, one at a time, when the playground runs.

Shortcut: Shift-Command-R

Pressing Shift-Command-R runs the latest version of your code, but shows what line is being run along the way.

Show or Hide Sidebar

Toggle the visibility of the navigation sidebar. Hiding the sidebar provides more space to view your code!

Shortcut: Option-Command-S

Pressing Option-Command-S shows or hides the sidebar.

Increase Text Size

Increase the size of text in the code window.

Shortcut: Command + or Command =

Press Command + to increase text size in the code window.

Decrease Text Size

Decrease the size of text in the code window.

Shortcut: Command -

Press Command - to decrease text size in the code window.

Select All Text

Select all the text in the code window.

Shortcut: Command-A

Press Command-A to select all the text in the code window.

Re-Indent

For any code that is selected, it will be re-indented.

This is a great way to clean up your code to make it more readable!

It can also be a way to spot syntax errors, when opening or closing curly brackets for a code block are missing.

Shortcut: Control-I

Press Control-I to re-indent (re-format) any selected code.

Shift Right

For the line of code the cursor is on, or for a selected block of code, shift the code to the right.

Shortcut: Command-]

Press Command-] to shift code to the right.

Shift Left

For the line of code the cursor is on, or for a selected block of text, shift the code to the left.

Shortcut: Command-[

Press Command-[ to shift code to the left.

Move to End of Current Line

Move the cursor to the end of the current line.

Shortcut: Command-→

Press Command-→ to move the cursor to the end of the current line.

Move to Start of Current Line

Move the cursor to the start of the current line.

Shortcut: Command-←

Press Command-← to move the cursor to the start of the current line.

Select Entire Line

Select an entire line of code, either above or below the cursor.

Shortcut: Shift-↑ or Shift-↓

Press Shift-↑ to select an entire line of code above the cursor, and Shift-↓ to select an entire line of code below the cursor.

Block Comment

Toggle a selected block of code between being commented out or active.

Code that is commented out will not be run by the playground.

Shortcut: Command-/

Press Command-/ to toggle a selected block of code between being commented out or being active.