Which MIME types are related to file extension ".tmlanguage"?

The .tmlanguage file extension is associated with 1 MIME types:

text/xml.

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

About .tmlanguage Files

TMLANGUAGE files are XML-based property list files used to define syntax and grammar rules for text editors.
They provide a set of instructions that help editors recognize language structures and apply color coding to code elements.
These files work by using XML tags to store rules such as regular expressions and scopes that determine how parts of a program are highlighted.

Based on information from FilExt.com, TMLANGUAGE files are essential for enabling efficient code parsing and clear syntax visualization in many development environments.

Relationship between file extension and MIME type

A file extension is a suffix at the end of a filename that indicates what type of file it is. File extensions help both users and operating systems identify what application should be used to open the file.

File extensions are typically separated from the filename by a period (dot) and consist of 2-4 characters, though they can be longer. For example, in the filename "document.pdf", ".pdf" is the file extension.

File extensions are closely related to MIME types, as they both serve to identify the format of a file. However, while MIME types are used primarily by web browsers and servers, file extensions are used by operating systems and applications.

Associated MIME types

text/xml

FAQs

What is a .tmlanguage file used for?

A .tmlanguage file is a syntax definition file used by text editors to understand the structure and grammar of a programming language. It contains XML-based rules and regular expressions that tell editors like TextMate, Sublime Text, and Visual Studio Code how to apply color coding (syntax highlighting) to source code.

How do I open and edit a .tmlanguage file?

Since these files are based on the XML Property List format, you can open them with any standard text editor, including Notepad++, Atom, or VS Code. For the best experience, use an editor that supports XML syntax highlighting, as the file's MIME type is generally treated as text/xml (see text/xml).

Can I convert .tmlanguage to JSON?

Yes, modern development environments often prefer JSON for readability. You can convert a .tmlanguage file (XML Plist) to a .tmLanguage.json file using tools like plutil on macOS (plutil -convert json syntax.tmlanguage) or various online "XML Plist to JSON" converters.

Why does Visual Studio Code use .tmlanguage files?

Visual Studio Code relies on TextMate grammars to power its syntax highlighting engine. While VS Code natively supports the XML-based .tmlanguage format for compatibility, extension authors are often encouraged to use the JSON equivalent for easier maintenance.

What is the difference between .tmlanguage and .tmTheme?

A .tmlanguage file defines the grammar (how to identify keywords, strings, and comments), whereas a .tmTheme file defines the colors applied to those identified parts. Both use the same XML structure, but they serve distinct roles in the text editing environment.

How do I create a custom syntax highlight using this format?

Creating a raw .tmlanguage file in XML can be verbose and error-prone. Most developers write their grammar in YAML or JSON first using tools like PackageDev for Sublime Text or yo code for VS Code, and then convert it to the .tmlanguage format if necessary.

Are .tmlanguage files compatible with all text editors?

Not all editors support them natively. This format is specific to the TextMate engine ecosystem, which includes TextMate, Sublime Text, Atom, and VS Code. Editors like Vim or Emacs use their own distinct systems for defining syntax highlighting.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why can one extension have multiple MIME types?

Different programs and historical usage may assign various MIME identifiers to the same file format. Listing them together helps maintain compatibility across tools.