WebStorm Cheatsheet - Frontend IDE Shortcut Reference

WebStorm brings JetBrains-grade tooling to JavaScript, and the payoff multiplies once you use its shortcuts. This reference covers editing and reformatting, completion/generation, navigation, refactoring, run/debug, Git and layout, all on the JetBrains keymap. It highlights the keys that matter for JS/TS work — smart completion, extract-to-const, git history — where the IDE genuinely beats editor-plus-CLI. After reading you jump between files, refactor and inspect git state without mousing over toolbar buttons.

Dev Tools·67 commands·Last updated 2026-07-21

Typical Use Case

For front-end and Node developers in JetBrains IDEs, primarily WebStorm on macOS. Seven groups cover the working day: basic editing, completion and generation, navigation and search, refactoring, debugging, Git integration, and window management. Only a few pairs matter enough to learn first — the command palette is the fallback when you cannot recall a key, rename updates every reference automatically, format plus optimise imports is the fixed pre-commit action, and the three step keys carry debugging. When a shortcut does not behave on Windows, looking the command up in the palette is the reliable way back.

Basic Editing 10

Cmd + D
Duplicate current line below
Cmd + Y
Delete whole line
Cmd + Shift + Enter
Complete statement (auto semicolons, braces)
Cmd + /
Toggle line comment
Cmd + Option + /
Toggle block comment
Cmd + Option + L
Reformat code
Cmd + Option + O
Optimize imports
Cmd + Option + I
Auto-indent
Cmd + Shift + J
Join lines
Cmd + Shift + U
Toggle case

Completion & Generation 11

Cmd + Space
Basic code completion
Cmd + Shift + Space
Smart code completion
Cmd + P
Parameter info
Cmd + J
Insert live template
Cmd + N
Generate code (constructor, getter/setter)
Cmd + Option + T
Surround with (if/for/try)
Cmd + Option + V
Extract variable
Cmd + Option + C
Extract constant
Cmd + Option + M
Extract method
Cmd + Option + F
Extract field
Cmd + Option + P
Extract parameter

Refactoring 9

Shift + F6
Rename
Cmd + F6
Change method signature
Cmd + Option + V
Extract variable
Cmd + Option + C
Extract constant
Cmd + Option + M
Extract method
Cmd + Option + N
Inline variable
Cmd + Option + K
Safe delete
F6
Move class/method
F5
Copy class/method

Debug & Run 10

Ctrl + R
Run current configuration
Ctrl + D
Debug current configuration
Cmd + F2
Stop
F8
Step over
F7
Step into
Shift + F8
Step out
Alt + F9
Run to cursor
Cmd + F8
Toggle breakpoint
Cmd + Shift + F8
View all breakpoints
Cmd + Option + R
Resume program

Git Integration 6

Cmd + K
Commit
Cmd + Shift + K
Push
Cmd + T
Pull
Cmd + Option + Z
Rollback
Cmd + Shift + A
Find action (search Git commands)
Cmd + 9
Open Git tool window

Windows & Views 8

Cmd + 1
Open/close Project panel
Cmd + 4
Open/close Run panel
Cmd + 7
Open/close Structure panel
Cmd + 9
Open/close Version Control panel
Cmd + Shift + F12
Maximize editor
Cmd + Option + F
Open/close Find panel
Cmd + ,
Open Settings
Cmd + ;
Open Project Structure

Parameter matrix

ParameterEffectExample
Cmd + DDuplicates the current line onto the line below it.Cmd + D
Cmd + YDeletes the whole line.Cmd + Y
Cmd + Shift + EnterCompletes the statement, inserting the closing brackets and the semicolon for you.Cmd + Shift + Enter
Cmd + /Toggles a line comment.Cmd + /
Cmd + Option + LReformats the code according to the configured code style.Cmd + Option + L
Cmd + Option + OOptimises imports, removing references that are no longer used.Cmd + Option + O
Cmd + Option + IRe-indents the current line or selection.Cmd + Option + I
Cmd + Shift + JJoins several lines into one.Cmd + Shift + J
Cmd + Shift + USwaps the case of the selection.Cmd + Shift + U
Cmd + SpaceBasic code completion.Cmd + Space
Cmd + Shift + SpaceSmart completion, which also completes chained calls further along the expression.Cmd + Shift + Space
Cmd + NGenerates boilerplate such as constructors and getter/setter pairs.Cmd + N
Cmd + Option + TWraps the selected code in an if, for or try template.Cmd + Option + T
Cmd + Option + V / C / MExtracts the selection into a variable, a constant or a method.Cmd + Option + M
Cmd + Option + F / PExtracts the selection into a field or a parameter.Cmd + Option + P
Shift + F6Renames a symbol and updates every reference to it across the project.Shift + F6
Cmd + Option + NInlines a variable, removing a needless intermediate name.Cmd + Option + N
Cmd + Option + KSafe delete: usages are searched before the symbol is removed.Cmd + Option + K
F6 / F5Move a class or method / Copy a class or method.F6
Cmd + O / Cmd + Shift + OJump to a class / Jump to a file.Cmd + O
Cmd + Option + OJump to a symbol such as a method or a variable.Cmd + Option + O
Cmd + B / Cmd + Option + BJump to a declaration / Jump to an implementation.Cmd + B
Cmd + UJump to the superclass or the implemented interface.Cmd + U
Cmd + GJump to a given line number.Cmd + G
Cmd + E / Cmd + Shift + ERecently opened files / Recently edited files.Cmd + E
Cmd + F12Opens the structure outline of the current file.Cmd + F12
Cmd + Shift + AOpens the Find Action command palette, which searches every available action by name.Cmd + Shift + A
Cmd + Shift + F / RSearch in project / Replace in project.Cmd + Shift + F
F7 / F8 / Shift + F8Step into / Step over / Step out.F8
Alt + F9Runs up to the caret without stopping there.Alt + F9
Cmd + F8 / Cmd + Shift + F8Toggle a breakpoint / List all breakpoints.Cmd + F8
Ctrl + R / Ctrl + DRun the current configuration / Debug the current configuration.Ctrl + R
Cmd + K / Cmd + Shift + K / Cmd + TCommit / Push / Pull.Cmd + K
Cmd + Option + ZRolls back the uncommitted changes in the current file.Cmd + Option + Z
Cmd + 1 / 4 / 7 / 9Toggle the Project / Run / Structure / Version Control tool windows.Cmd + 9
Cmd + Shift + F12Maximises the editor area.Cmd + Shift + F12

Common pitfalls

SymptomAfter a rename the project no longer compiles, even though the rename itself reported success.

CauseA manual find and replace only touched the current file and missed dynamic references; the IDE rename works off its index and updates every reference project-wide.

FixUse Shift+F6 so the IDE rewrites all references, then run Cmd + Option + O to drop the imports left dangling.

SymptomFormatting makes the code look worse and produces a large meaningless diff against a colleague version.

CauseCode style settings differ between machines or between projects, so each formatter reflows indentation and quotes by its own rules.

FixAgree on one code style, commit the configuration file, and run Cmd + Option + L consistently before every commit.

SymptomThe Cmd shortcuts do nothing at all on a Windows install.

CauseThis sheet lists macOS Cmd chords; the Windows equivalents are Ctrl combinations, and a few of them also need a function key held down.

FixOpen the Cmd + Shift + A command palette and search actions by their functional name; the panel shows and runs the correct chord for the current OS.

SymptomA project-wide replace also rewrote comments, string literals and same-named locals, quietly changing behaviour.

CauseCmd + Shift + R is a text-level replace and cannot tell identifiers from string literals.

FixPrefer Shift+F6 whenever a rename is what you actually mean; when a text replace is unavoidable, review the preview entry by entry and narrow the scope.

SymptomStepping through a debug session keeps descending into logging and utility libraries instead of the business code.

CauseF7 steps into every call including third-party code, while F8 runs past the current function one line at a time.

FixDefault to F8 for stepping, use F7 only when the internals of a function matter, and leave the function with Shift + F8.

SymptomA file is missing from the commit dialog, or a change still shows as uncommitted after committing.

CauseThe file may be untracked or partially excluded, so check both the Changes and Untracked groups in the version control tool window.

FixOpen the Cmd + 9 version control panel, add the Untracked files to the staging area, then commit with Cmd + K.

SymptomCmd + Option + V refuses to extract, or evaluates the expression incorrectly.

CauseThe selection is not a complete expression, it straddles a statement boundary, or it contains side effects or nested calls that the IDE refuses to split.

FixSelect exactly one whole expression before extracting, add parentheses by hand if precedence is ambiguous, then run Cmd + Option + V.

SymptomAn action cannot be found in the command palette and the IDE is assumed not to have it.

CauseThe palette matches against bound action names, and informal or translated descriptions frequently miss; you need the English action name or a feature keyword.

FixSearch again with a feature keyword such as format, rename or extract, and if no such action exists, bind your own chord under the Keymap settings.

Troubleshooting

  1. 1Look up an unknown chord in the command palette

    Cmd + Shift + A -> type an action keyword (for example Reformat Code or Rename)

    The palette lists every matching action together with the chord valid on the current operating system, and it is the only reliable way to look chords up across platforms. When you cannot remember a shortcut, always come through here.

  2. 2The standard two-step before committing

    Cmd + Option + L (Reformat Code) -> Cmd + Option + O (Optimize Imports) -> Cmd + K (Commit)

    Formatting normalises indentation and quotes, optimising imports removes what is no longer referenced, and once both have run the diff contains real logic changes only, which keeps review noise at a minimum.

  3. 3Navigation entry points for a wide search

    Cmd + O (Go to Class) -> Cmd + Shift + O (Go to File) -> Cmd + Option + O (Go to Symbol) -> Cmd + B (Go to Declaration)

    These four cover almost every "where is it" question: Cmd + B moves from a usage to its declaration, Cmd + Option + B moves from an interface to the implementation, and using them as a pair quickly exposes the call chain.

  4. 4Confirm the usage surface before refactoring

    select a symbol -> Shift + F6 (Rename, previews every affected usage) -> Cmd + Option + K (Safe Delete)

    The IDE lists every reference before renaming, so check for stragglers in strings or configuration files before confirming, and prefer safe delete over deleting outright so leftover usages surface first.

  5. 5The standard debugging loop

    Ctrl + D (Debug) -> Cmd + F8 (Toggle Breakpoint) -> F8 Step Over / F7 Step Into / Shift + F8 Step Out -> Cmd + F2 (Stop)

    Set breakpoints before starting the debug session and control granularity with the trio: F8 advances a line without descending, F7 enters the function, Shift + F8 returns to the caller immediately. While stopped, Cmd + Shift + F8 confirms whether the breakpoint sits on a path that is actually executed.

  6. 6Recovering after a mistaken action

    Cmd + Option + Z (Rollback) -> Cmd + E (Recent Files)

    Rollback discards the uncommitted changes in the current file, and Cmd + E lists recently opened files; together with Cmd + Shift + E for the edit history it is the fastest way to recover context lost to a mis-click or a mis-jump.

  7. 7Reading structure and reaching a line without the mouse

    Cmd + F12 (File Structure) -> Cmd + G (Go to Line)

    The F12 outline beats scrolling in a long file because it shows the class and function hierarchy, while Cmd + G jumps straight from a line number in a stack trace to the offending line.

Command Examples

Stop memorising shortcuts, use the command palette

Cmd + Shift + A

Type a keyword (commit, reformat, extract) and every matching action appears, Git commands included. When a shortcut slips your mind, this beats hunting through Settings for the keymap.

Refactor a long expression into a named variable

Cmd + Option + V

Select an expression and run it: the IDE declares the variable in the current scope and rewrites every reference, and Ctrl+Alt+V again lets you keep extracting and renaming in the same pass.

Rename safely across the whole project

Shift + F6

Renaming is index-based: interfaces, string references, tests and configuration files all update together, and a preview panel shows the diff before you commit. This is far safer than a textual global replace (Cmd+Shift+R).

The debugging trio: breakpoint, step into, step over

Cmd + F8 F7 F8 Shift + F8

Cmd+F8 toggles a breakpoint, F7 steps into a method, F8 steps over the line, and Shift+F8 jumps out of the current method. When F7 and F8 blur together, remember: F7 goes inward, F8 goes past.

Generate boilerplate instead of typing getters by hand

Cmd + N

Triggered on a class name, this generates constructors, getters and setters, equals/hashCode, and interface implementations. Filling in the generated body beats typing it and then fixing formatting errors.

Common Pitfalls

  • Cmd+Shift+R does a textual replace with no semantic understanding and happily breaks string concatenation, comments, and XML config; use an index-based rename like Shift+F6 instead.
  • Cmd+Option+N inline-variable deletes the extracted expression outright. If that expression had side effects, the semantics change silently.
  • Cmd+Option+K safe delete only understands known symbols; classes resolved through strings, DI containers, or XML config produce no compile error and only blow up at runtime.
  • Cmd+K commits and Cmd+Shift+K pushes are separate actions — pushing does not commit. Believing you "pushed" while the commit sits locally is the most common VCS misjudgement.
  • Cmd+Option+R rollback discards uncommitted changes in the current file with no confirmation dialog; hitting it after Cmd+Shift+E have moved on can lose the work for good.
  • Pressing Delete without a modifier deletes to end of line, not the selection — with the caret mid-expression it silently removes the rest of the code.

Tips

  • Cmd+Shift+A is the Command Palette; search any action without memorizing shortcuts.
  • Cmd+O and Cmd+Shift+O jump to classes and files, much faster than clicking.
  • Refactor shortcuts (Shift+F6 rename) update all references automatically - safer than manual find/replace.
  • Cmd+E shows recently opened files; quick switching is very useful.
  • Cmd+Option+L reformats code and Cmd+Option+O optimizes imports; run before committing.
  • When debugging, F7 steps in, F8 steps over, Shift+F8 steps out - master these three.

FAQ

I do not want to memorise shortcuts — is there one entry point that finds everything?

The command palette. Press Cmd + Shift + A and type an action keyword to search every command, including Git actions, navigation, refactorings and run configurations — even ones you cannot find in the menus. The same philosophy shows up in Cmd + Shift + F for global text search and Cmd + Shift + R for global replace. Make it a habit: hit the palette once, memorise the keys for the frequent commands, and leave the rare ones to the palette forever.

Renaming feels risky — how is the refactor shortcut better than find and replace?

Shift + F6 runs a reference analysis first, shows you every affected location for review, then rewrites the definition and all call sites in one pass that you can still undo before committing. That is fundamentally different from Cmd + Shift + R, which is plain text matching and will happily rewrite strings, comments, and same-named symbols in unrelated scopes. Cmd + Option + M (extract method), Cmd + Option + C (extract constant) and Cmd + Option + F (extract field) are the same kind of reference-aware operations.

When should I press F7, F8 and Shift+F8 while debugging?

F7 steps into the body of the method under the cursor. F8 steps over it — the line runs to completion without entering the function — which is how you skip getters, logging calls and other noise. Shift + F8 steps out, returning to the caller, and is the quickest way out of a loop or a long call chain. Alt + F9 runs straight to the line holding the cursor instead of stepping line by line. Enter via Ctrl + R to run or Ctrl + D to debug, place breakpoints with Cmd + F8 and review them all with Cmd + Shift + F8.

How do I choose between Cmd+O, Cmd+Shift+O and Cmd+Option+O for navigation?

They search at different granularities. Cmd + O jumps to a class by name; Cmd + Shift + O jumps by file name, which is what you want when you only remember a fragment of the filename; Cmd + Option + O locates a symbol — method or field — within the current file without leaving it. The related set is Cmd + B for the declaration, Cmd + Option + B for the implementation, and Cmd + U for the parent class or interface. In a large codebase, locate the class with Cmd + O and then move between declaration and implementation beats scrolling the Project panel.

Which shortcuts are worth making automatic before committing?

Run at least three passes before committing: Cmd + Option + L to format the code, Cmd + Option + O to optimise imports and Cmd + Option + I to fix indentation — each works on the whole file rather than the selection. For daily editing use Cmd + D to duplicate the line, Cmd + Y to delete it, Cmd + / to toggle a line comment and Cmd + Option + / for a block comment. In the Git integration, Cmd + K commits, Cmd + Shift + K pushes, Cmd + T pulls, and Cmd + 9 opens the Git tool window.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us