header background image

How to associate files with a specific extension to a language in VSCode

2024年5月4日☕️ 1 min read

When editing shell template files for chezmoi in VSCode, I will introduce a method to associate files with the extension .sh.tmpl with shellscript.

Configuration Steps

  1. Open Preferences: User Settings(JSON)

Press Command + Shift + P and select Preferences: Open User Settings (JSON).

  1. Add a configuration to associate *.sh.tmpl files with shellscript in the opened JSON file.
"files.associations": {
  "*.sh.tmpl": "shellscript"
}

With these steps, files with the .sh.tmpl extension will be treated as shellscript.

ThunderMiracle

Blog part of ThunderMiracle.com

Comments load when in view