AI Workshop: learn to build apps with AI →
VS Code Tips: Language-Specific Settings

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


Different languages have different conventions for indentation and formatting. VS Code lets you configure settings per language.

Setting Up Language-Specific Settings

Open VS Code preferences (Cmd+,) and add language-specific settings using this format:

"[language-id]": {
    "setting.name": value
}

Example: Different Tab Sizes per Language

Here’s an example configuration with different settings for JavaScript, CSS, HTML, and Go:

{
  "[javascript]": {
    "editor.insertSpaces": true,
    "editor.tabSize": 2
  },
  "[css]": {
    "editor.insertSpaces": true,
    "editor.tabSize": 2
  },
  "[html]": {
    "editor.insertSpaces": true,
    "editor.tabSize": 4
  },
  "[go]": {
    "editor.insertSpaces": false,
    "editor.tabSize": 8
  }
}

In this example:

  • JavaScript and CSS use 2 spaces.
  • HTML uses 4 spaces.
  • Go uses tabs with a width of 8 (following Go conventions).

Markdown-Specific Settings

When writing Markdown, you might want to disable autocomplete popups:

{
  "[markdown]": {
    "editor.renderWhitespace": "all",
    "editor.acceptSuggestionOnEnter": "off",
    "editor.parameterHints.enabled": false,
    "editor.quickSuggestions": false,
    "editor.snippetSuggestions": "none"
  }
}

This disables all the IntelliSense features that can be distracting when writing prose rather than code.

Other Useful Language Settings

You can override any editor setting per language, including:

  • editor.defaultFormatter - which formatter to use
  • editor.formatOnSave - enable/disable format on save
  • editor.wordWrap - line wrapping behavior
  • editor.rulers - column guides

Lessons in this unit:

0: Introduction
1: Setup and Configuration Tips
2: Terminal Tips
3: Editing Tips
4: Prettier and Auto-Formatting
5: ▶︎ Language-Specific Settings
6: Emmet for Faster HTML/CSS
7: Debugging in VS Code
8: Fix node modules import errors in VS Code
9: Fixing TS issues in VS Code - Astro
10: Regex: select entire line starting with...