adding-textmate-grammars

Register TextMate grammars with Visual Studio via pkgdef for syntax colorization.

14|2|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/madskristensen/vs-agent-plugins --skill adding-textmate-grammars
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-textmate-grammars
Source: https://github.com/madskristensen/vs-agent-plugins/tree/main/skills/adding-textmate-grammars
Command: npx skills add https://github.com/madskristensen/vs-agent-plugins --skill adding-textmate-grammars

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Lightweight syntax highlighting for custom languages in Visual Studio extensions using TextMate grammars. It enables colorization, bracket matching, and basic editor support without writing a full MEF classifier.

Core Features & Use Cases

  • Lightweight, declarative grammar definitions via .tmlanguage, .json, or .plist files
  • Register grammars with a pkgdef and include them in a VSIX so VS can apply colorization to matching file extensions
  • Pair grammars with optional language-configuration.json for editor behaviors and with LSP where advanced IntelliSense is provided by a language server

Quick Start

Add your TextMate grammar to a VSIX project, register it with a languages.pkgdef, and include an optional language-configuration.json for editor behaviors.

Frequently Asked Questions about adding-textmate-grammars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add TextMate grammar syntax highlighting to a Visual Studio extension?

To add TextMate grammar highlighting to a Visual Studio extension, you register lightweight .tmlanguage or .json grammar files using a pkgdef and include them in a VSIX project so VS can apply colorization to matching file extensions.

Can I use a TextMate grammar instead of writing a full MEF classifier for custom languages?

Yes, you can use a TextMate grammar instead of a full MEF classifier to enable declarative colorization, bracket matching, and basic editor support for custom languages without writing runtime code.

Does Visual Studio TextMate highlighting work with language-configuration.json?

Yes, Visual Studio TextMate highlighting works with an optional language-configuration.json file to define editor behaviors, and it can be paired with a Language Server Protocol implementation for advanced IntelliSense.

What is the best way to register a TextMate grammar in a VSIX package?

The best way to register a TextMate grammar in a VSIX package is by placing the grammar in a Grammars/ directory and registering it via a languages.pkgdef file, leveraging VSSDK tooling for in-process registration.

Do I need to write runtime code to enable TextMate colorization in Visual Studio?

No, you do not need to write runtime code to enable TextMate colorization in Visual Studio; the process requires no runtime code beyond the VSIX shell and leverages VSSDK/VSIX tooling for grammar registration.