Skip to main content

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

CommandKey
Select upShift+Up
Select downShift+Down
Select lineCtrl+L
Cut line (without selection)Ctrl+X
Copy line (without selection)Ctrl+C
PasteCtrl+V
Delete lineCtrl+Shift+K
Move Line DownAlt+Down
Move Line UpAlt+Up
Copy Line DownShift+Alt+Down
Copy Line DownShift+Alt+Up
UndoCtrl+Z
RedoCtrl+Y
FormatCtrl+S
Add cursorsAlt+Left Click
Undo last cursor operationCtrl+U
Select all occurrences of current selectionCtrl+Shift+L
Select all occurrences of current wordCtrl+F2
Jump to matching bracketCtrl+Shift+\
Indent LineCtrl+]
Outdent LineCtrl+[
Go to Beginning of LineHome
Go to End of LineEnd
Go to End of FileCtrl+End
Go to Beginning of FileCtrl+Home
Scroll Line DownCtrl+Down
Scroll Line UpCtrl+Up
Collapse regionCtrl+Shift+[
Uncollapse regionCtrl+Shift+]
Collapse all regionsCtrl+K Ctrl+0
Uncollapse all regionsCtrl+K Ctrl+J
Add Line CommentCtrl+K Ctrl+C
Remove Line CommentCtrl+K Ctrl+U
Toggle Line CommentCtrl+/
Add Block CommentShift+Alt+A
FindCtrl+F
ReplaceCtrl+H
Find NextEnter
Find PreviousShift+Enter
Add Selection To Next Find MatchCtrl+D
Select All Occurrences of Find MatchAlt+Enter
Trigger SuggestCtrl+Space
Go to Referencesctrl+F12
Peek Definitionshift+F12
Rename SymbolF2
Generate Code (hacker only)Alt+G
CommandKey
Go to Line...Ctrl+G
Go to File..., Quick OpenCtrl+P
Show Problems/invite linkCtrl+Shift+M
Go to Next Error or WarningF8
Show command paletteCtrl+Shift+P or F1 (use F1 on Firefox).
Go BackAlt+Left
Go ForwardAlt+Right
Show Version ControlCtrl+Shift+G
Show SearchCtrl+Shift+F
Open SettingsCtrl+,

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.

command palette

Moving the current line

Press Alt+Up or Alt+Down to move the current line up or down.

move line

Clone the current line

Press Shift+Alt+Up or Shift+Alt+Down to clone the current line above or below.

clone line

Selecting lines

Press Ctrl+L to select a line.

select line

Deleting lines

Press Ctrl+Shift+K to delete a line.

delete line

Adding cursors

Press Alt+Left Click to add more cursors.

adding cursors

Find

Press Ctrl+F to find.

find

Replace

Press Ctrl+H to replace.

replace

Adding selections to next find match

Press Ctrl+D to select and then Ctrl+F to add a selection to the next find match.

adding selections

Use the following shortcuts to navigate the editor.

Open files

Press Ctrl+P to quickly open files.

Open files

Go to line

Press Ctrl+G to go to a specified line.

go to line