Working with shortcuts
Be more productive with Replit by learning the code editor’s powerful shortcuts for editing, writing, and inspecting code.
The shortcuts we'll show you here are for Windows. If you're using a Mac, use the Cmd
key instead of the Ctrl
key, and the Option
key instead of the Alt
key.
When you use a shortcut, be sure that your repl window has been clicked, or these shortcuts may access the browser's keyboard shortcuts.
Basic editing
Command | Key |
---|---|
Select up | Shift+Up |
Select down | Shift+Down |
Select line | Ctrl+L |
Cut line (without selection) | Ctrl+X |
Copy line (without selection) | Ctrl+C |
Paste | Ctrl+V |
Delete line | Ctrl+Shift+K |
Move Line Down | Alt+Down |
Move Line Up | Alt+Up |
Copy Line Down | Shift+Alt+Down |
Copy Line Down | Shift+Alt+Up |
Undo | Ctrl+Z |
Redo | Ctrl+Y |
Format | Ctrl+S |
Add cursors | Alt+Left Click |
Undo last cursor operation | Ctrl+U |
Select all occurrences of current selection | Ctrl+Shift+L |
Select all occurrences of current word | Ctrl+F2 |
Jump to matching bracket | Ctrl+Shift+\ |
Indent Line | Ctrl+] |
Outdent Line | Ctrl+[ |
Go to Beginning of Line | Home |
Go to End of Line | End |
Go to End of File | Ctrl+End |
Go to Beginning of File | Ctrl+Home |
Toggle Line Comment | Ctrl+/ |
Add Block Comment | Shift+Alt+A |
Find | Ctrl+F |
Find Next | Enter |
Find Previous | Shift+Enter |
Add Selection To Next Find Match | Ctrl+D |
Select All Occurrences of Find Match | Alt+Enter |
Trigger Suggest | Ctrl+Space |
Go to References | ctrl+F12 |
Peek Definition | shift+F12 |
Rename Symbol | F2 |
Generate Code (Ghostwriter subscription required) | Alt+G |
Navigation
Command | Key |
---|---|
Go to Line... | Ctrl+G |
Go to File..., Quick Open | Ctrl+P |
Go to Next Error or Warning | F8 |
Show command palette | Ctrl+Shift+P or F1 (use F1 on Firefox). |
Go Back | Alt+Left |
Go Forward | Alt+Right |
Show Version Control | Ctrl+Shift+G |
Show Search | Ctrl+Shift+F |
Open Settings | Ctrl+, |
Frequently used keyboard shortcuts
The following keyboard shortcuts can be used in a variety of ways. If you forget a keyboard shortcut, check the command palette.
Command palette
The command palette allows you to view all available commands based on your current context.
To access the command palette, press F1
or Ctrl+Shift+P
.
Note: If you are using Firefox, Ctrl+Shift+P
will open an incognito window, so use the F1
option instead.
Moving the current line
Press Alt+Up
or Alt+Down
to move the current line up or down.
Clone the current line
Press Shift+Alt+Up
or Shift+Alt+Down
to clone the current line above or below.
Selecting lines
Press Ctrl+L
to select a line.
Deleting lines
Press Ctrl+Shift+K
to delete a line.
Adding cursors
Press Alt+Left Click
to add more cursors.
Find
Press Ctrl+F
to find.
Adding selections to next find match
Press Ctrl+D
to select and then Ctrl+F
to add a selection to the next find match.
Navigation
Use the following shortcuts to navigate the editor.
Open files
Press Ctrl+P
to quickly open files.
Go to line
Press Ctrl+G
to go to a specified line.