Keyboard Shortcuts in Playgrounds
19 September, 2021
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 the latest version of your code.
Step Through My Code
Step through your code, showing what line is being run, one at a time, when the playground runs.
Show or Hide Sidebar
Toggle the visibility of the navigation sidebar. Hiding the sidebar provides more space to view your code!
Increase Text Size
Increase the size of text in the code window.
Shortcut: Command + or Command =
Decrease Text Size
Decrease the size of text in the code window.
Shortcut: Command -
Select All Text
Select all the text in the code window.
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.
For the line of code the cursor is on, or for a selected block of code, shift the code to the right.
For the line of code the cursor is on, or for a selected block of text, shift the code to the left.
Move to End of Current Line
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.
Select Entire Line
Select an entire line of code, either above or below the cursor.
Shortcut: Shift-↑ or Shift-↓
Toggle a selected block of code between being commented out or active.
Code that is commented out will not be run by the playground.