You can’t use your mouse at the command line, so it’s important to know how to move around quickly so you’re not restricted to just using your arrows. Jump back to the beginning of the line with Ctrl + A:
Mac OS, Windows: Ctrl + E
Use your up and down arrows to scroll through your command history so that you don’t have to re-type your commands over and over.
Mac OS: Command + K
Windows: Disabled by default1. See below instructions to enable it — we strongly recommend that you do this.
From the menu open Preferences and select Keyboard shortcuts.
Then search for “terminal clear” in the search bar and click the plus icon to the left of it.
Finally, type ctrl + k and Enter to confirm.
If something goes wrong with a terminal program (i.e. you made a typo, a program gets stuck in an infinite loop, etc), you can generally interrupt it with Ctrl + C:
When the output of a terminal command is too tall for a terminal tab to display at once, it paginates. Press Space to step through it one page at a time, or Q to quit and get back to the terminal prompt so that you can execute your next command.
Mac OS, Windows: Q
The most important thing to memorize is how to open the Command Palette, which will allow you to fuzzy search within for all other commands. If the command has a keyboard shortcut mapped to it, the shortcut will be displayed to the right. This is the best way to learn the keyboard shortcuts for the commands that you use most frequently.
Mac OS: Command + Shift + P
Windows: Ctrl + Shift + P
To quickly jump to a file:
Mac OS: Command + P
Windows: Ctrl + P
And then fuzzily search for its name. For example, you could type “phco” to get to photos_controller.rb and the list would quickly narrow to bring that file to the top of the list.
To quickly comment a line of code, put your cursor on that line and then:
Mac OS: Command + /
Windows: Ctrl + /
You can also highlight multiple lines of code and comment/uncomment all of them at once.
Mac OS: Command + F
Windows: Ctrl + F
Mac OS: Command + D
Windows: Ctrl + D
If you go too far by mistake, you can step backwards with Command + U or Ctrl + U.
Mac OS: Option + ⬇
Windows: Alt + ⬇
Mac OS: Shift + Option + ⬇
Windows: Shift + Alt + ⬇
Mac OS: (Shift) + Tab
Windows: (Shift) + Tab
Mac OS: Option + Click
Windows: Alt + Click
Mac OS, Windows: Ctrl + Shift + `
Mac OS: Command + J
Windows: Ctrl + J
Mac OS: Ctrl + ~ (i.e. Ctrl + Shift + `)
Windows: Ctrl + ~ (i.e. Ctrl + Shift + `)
A recent Gitpod update removed this keyboard shortcut for Windows, so you’ll need to configure it yourself. ↩