Gitpod keyboard shortcuts and other productivity tips

Important Terminal keystrokes to know

Jump to beginning of line

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:

Jump to end of line

Mac OS, Windows: Ctrl + E

Up and down arrows to scroll through your history

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.

Clear Terminal

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.

Interrupt command

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:

Q to exit

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

Editor keyboard shortcuts

Command Palette

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

Quick open file

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.

Toggle Code Comment

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.

Find (and replace)

Mac OS: Command + F

Windows: Ctrl + F

Find Next Selection

Mac OS: Command + D

Windows: Ctrl + D

If you go too far by mistake, you can step backwards with Command + U or Ctrl + U.

Move line

Mac OS: Option +

Windows: Alt +

Duplicate line

Mac OS: Shift + Option +

Windows: Shift + Alt +

Add/Remove Tab spaces for multiple lines

Mac OS: (Shift) + Tab

Windows: (Shift) + Tab

Add More Cursors

Mac OS: Option + Click

Windows: Alt + Click

Embedded Ruby (ERB) Tag Toggle

Mac OS, Windows: Ctrl + Shift + `

Toggle Terminal Panel

Mac OS: Command + J

Windows: Ctrl + J

Open New Terminal

Mac OS: Ctrl + ~ (i.e. Ctrl + Shift + `)

Windows: Ctrl + ~ (i.e. Ctrl + Shift + `)

  1. A recent Gitpod update removed this keyboard shortcut for Windows, so you’ll need to configure it yourself.