Skip to content
back to cheatsheets

Keyboard Shortcuts Cheatsheet — VS Code, DevTools, Terminal & OS

· Reference

Keyboard shortcuts eliminate the time spent reaching for menus and mice. This reference covers the shortcuts that matter most for web development across your editor, browser, terminal, and operating system.

Notation: Cmd = macOS Command key. Windows/Linux equivalent is Ctrl unless noted. Opt = macOS Option key, equivalent to Alt on Windows/Linux.

VS Code — Editing

ActionmacOSWindows/Linux
Cut lineCmd+XCtrl+X
Copy lineCmd+CCtrl+C
Move line up/downOpt+Up/DownAlt+Up/Down
Copy line up/downShift+Opt+Up/DownShift+Alt+Up/Down
Delete lineCmd+Shift+KCtrl+Shift+K
Insert line belowCmd+EnterCtrl+Enter
Insert line aboveCmd+Shift+EnterCtrl+Shift+Enter
Indent lineCmd+]Ctrl+]
Outdent lineCmd+[Ctrl+[
Toggle commentCmd+/Ctrl+/
Block commentShift+Opt+AShift+Alt+A
Format documentShift+Opt+FShift+Alt+F
Rename symbolF2F2
Quick fixCmd+.Ctrl+.
Trigger suggestionCtrl+SpaceCtrl+Space
Toggle word wrapOpt+ZAlt+Z

VS Code — Multi-cursor and Selection

ActionmacOSWindows/Linux
Add cursor above/belowCmd+Opt+Up/DownCtrl+Alt+Up/Down
Add cursor at clickOpt+ClickAlt+Click
Select current wordCmd+DCtrl+D
Select all occurrencesCmd+Shift+LCtrl+Shift+L
Select lineCmd+LCtrl+L
Expand selectionCtrl+Shift+Cmd+RightShift+Alt+Right
Shrink selectionCtrl+Shift+Cmd+LeftShift+Alt+Left
Column selectionShift+Opt+DragShift+Alt+Drag

VS Code — Navigation

ActionmacOSWindows/Linux
Command paletteCmd+Shift+PCtrl+Shift+P
Quick open fileCmd+PCtrl+P
Go to symbolCmd+Shift+OCtrl+Shift+O
Go to lineCtrl+GCtrl+G
Go to definitionF12F12
Peek definitionOpt+F12Alt+F12
Go backCtrl+-Alt+Left
Go forwardCtrl+Shift+-Alt+Right
Toggle sidebarCmd+BCtrl+B
Toggle terminalCtrl+`Ctrl+`
Toggle explorerCmd+Shift+ECtrl+Shift+E
Toggle searchCmd+Shift+FCtrl+Shift+F
Switch tabsCmd+1-9Ctrl+1-9
Close tabCmd+WCtrl+W
Reopen closed tabCmd+Shift+TCtrl+Shift+T
Split editorCmd+\Ctrl+\
Find in filesCmd+Shift+FCtrl+Shift+F
Find and replaceCmd+Opt+FCtrl+H

Chrome DevTools

ActionmacOSWindows/Linux
Open DevToolsCmd+Opt+ICtrl+Shift+I or F12
Open ConsoleCmd+Opt+JCtrl+Shift+J
Open Elements panelCmd+Opt+CCtrl+Shift+C
Inspect elementCmd+Shift+CCtrl+Shift+C
Toggle device toolbarCmd+Shift+MCtrl+Shift+M
Run commandCmd+Shift+PCtrl+Shift+P
Open fileCmd+PCtrl+P
Search across filesCmd+Opt+FCtrl+Shift+F
Toggle dock positionCmd+Shift+DCtrl+Shift+D
Clear consoleCmd+KCtrl+L
Step over (debugging)F10F10
Step intoF11F11
Step outShift+F11Shift+F11
Resume executionF8F8
Toggle breakpointCmd+BCtrl+B
Hard refresh (no cache)Cmd+Shift+RCtrl+Shift+R

Terminal / Command Line

ActionmacOS/LinuxDescription
Ctrl+CInterrupt/kill current process
Ctrl+DExit shell / send EOF
Ctrl+ZSuspend current processResume with fg
Ctrl+LClear screenSame as clear
Ctrl+AMove cursor to start of line
Ctrl+EMove cursor to end of line
Ctrl+WDelete word before cursor
Ctrl+UDelete from cursor to start of line
Ctrl+KDelete from cursor to end of line
Ctrl+RReverse search history
Ctrl+P / UpPrevious command
Ctrl+N / DownNext command
Opt+LeftMove back one wordMay need terminal config
Opt+RightMove forward one wordMay need terminal config
!!Repeat last command
!$Last argument of previous command
TabAuto-complete
Tab TabShow all completions

macOS System

ActionShortcut
Spotlight searchCmd+Space
Switch applicationCmd+Tab
Switch windows of same appCmd+`
Close windowCmd+W
Quit applicationCmd+Q
Force quitCmd+Opt+Esc
Screenshot (full)Cmd+Shift+3
Screenshot (selection)Cmd+Shift+4
Screenshot (window)Cmd+Shift+4, Space
Screen recordingCmd+Shift+5
Lock screenCmd+Ctrl+Q
Show desktopF11 or Cmd+F3
Mission ControlCtrl+Up or F3
Emoji pickerCtrl+Cmd+Space
Minimize windowCmd+M
Full screenCmd+Ctrl+F

Windows System

ActionShortcut
SearchWin+S
Switch applicationAlt+Tab
Close windowAlt+F4
Task managerCtrl+Shift+Esc
Screenshot (full)Win+PrtScn
Screenshot (selection)Win+Shift+S
Lock screenWin+L
Show desktopWin+D
Virtual desktopsWin+Tab
Snap left/rightWin+Left/Right
File explorerWin+E
SettingsWin+I
Emoji pickerWin+.
Clipboard historyWin+V

Look up JavaScript key codes with the Keyboard Keycodes tool.

#Learn More