· 01:34
Hello and welcome to the It’s FOSS podcast. Today we’re tackling a simple but powerful feature in VS Code: indentation. As the article reminds us, “Indentation is how code is visually spaced. It helps define structure, scope, and readability.” Whether you prefer two spaces, four spaces, or tabs, VS Code lets you customize it per file, per project, or per language.
On a per-file basis, just click the “Spaces: 4” or “Tab Size: 4” label in the status bar, choose your settings, then hit Format Document—Ctrl Shift I on Linux, Shift Alt F on Windows, or Shift Option F on macOS—and “Boom! The file gets prettied up with your chosen indentation.”
For global or workspace settings, open Preferences in the Command Palette and set your default tab size and insert-spaces option. You can even add language-specific rules in settings.json, like four spaces for Python and two for JavaScript.
Finally, if your file’s indentation is a mess, use the Convert Indentation command to switch tabs to spaces or vice versa. Clean, consistent indentation makes your code—and your collaboration—much smoother. Thanks for listening, and stay tuned for more VS Code tips.
Link to Article
Listen to jawbreaker.io using one of many popular podcasting apps or directories.