· 2 min read
VS Code Config: Enforcing a Coding Style with Rulers
A minimal VS Code settings.json: an 80-column ruler, visible whitespace and fixed indentation to enforce a shared coding style across the team.
Also available in Français

Why a Ruler?
In a team, respecting a code style is essential.
One of VS Code’s simple tools is the ruler: a vertical line displayed in the editor at a given column (e.g. 80 characters).
It helps you keep track of how far you write on each line: better readability, consistency between developers, following best practices.
Minimal Configuration Example
Here is a settings.json configuration for VS Code, focused on the essentials:
{
"editor.rulers": [80],
"workbench.startupEditor": "newUntitledFile",
"git.autofetch": true,
"editor.detectIndentation": false,
"editor.renderWhitespace": "all",
"workbench.panel.defaultLocation": "right",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontFamily": "monospace",
"window.menuBarVisibility": "toggle",
"diffEditor.ignoreTrimWhitespace": false
}Quick Explanations
"editor.rulers": [80]
Displays a vertical guide at column 80 → ideal for keeping code readable and consistent."workbench.startupEditor": "newUntitledFile"
VS Code opens an empty file directly on startup → saves time, you start coding right away."git.autofetch": true
Automatically updates remote Git information → you always see the real state of the project without a manual fetch."editor.detectIndentation": false
Prevents VS Code from trying to “guess” indentation → the editor follows your rules, not those detected in the file."editor.renderWhitespace": "all"
Visually displays spaces and tabs → avoids invisible style errors."workbench.panel.defaultLocation": "right"
Places the panel (console) on the right instead of at the bottom.
👉 If you deliberately limit yourself to 80-column lines, it’s better to keep more vertical space than horizontal space.
This remains a personal choice; everyone adapts to their own comfort.
A Clear Style, for the Whole Team
Setting up these simple rules in VS Code helps you:
- have more readable code,
- ensure consistency between developers,
- and avoid invisible errors (spaces, inconsistent indentation).
A small tweak to your settings.json, and you lay the foundations for a shared coding style across your projects.