DELAPARRA
Index
Color
NL
Category: Keyboard shortcuts

Format Document

Explained by Updated

What is Format Document?

Format Document: Re-indent and tidy the whole file using the configured formatter (Prettier, gofmt, etc.). Format Document runs your configured code formatter on the whole file. In VS Code it is Shift+Alt+F or Shift+Option+F. JetBrains IDEs use Ctrl+Alt+L or Cmd+Option+L. The formatter fixes indentation, spacing, line breaks and quote style according to the project's rules. Prettier, Pint, Black and gofmt are common examples.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Format Document

What should you keep in mind with Format Document?

Better still, enable format on save, so files are always tidy without you thinking about it. Make sure the formatter and its configuration are part of the project rather than your personal editor settings, so the whole team gets the same result. Then add a formatting check to CI. With that in place, formatting never comes up in code reviews again, and reviewers can focus on what the code does.

At a glance

CategoryKeyboard shortcuts
Explained by
Updated

More Keyboard shortcuts terms

All terms starting with F

Skills

Manuals

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.