4

I am currently working with nodejs modules and, despite being just js files, it uses the mjs extension when I declare --experimental-modules. Is there a way I can map Sublime Text to treat mjs as js?

5

Is there a way I can map Sublime Text to treat mjs as js?

See the following answer from StackOverflow:

In the current version of Sublime Text 2 (Build: 2139), you can set the syntax for all files of a certain file extension using an option in the menu bar. Open a file with the extension you want to set a default for and navigate through the following menus: View -> Syntax -> Open all with current extension as... ->[your syntax choice].

Updated 2012-06-28: Recent builds of Sublime Text 2 (at least since Build 2181) have allowed the syntax to be set by clicking the current syntax type in the lower right corner of the window. This will open the syntax selection menu with the option to Open all with current extension as... at the top of the menu.

Updated 2016-04-19: As of now, this also works for Sublime Text 3.

Source Set default syntax to different filetype in Sublime Text 2, answer by Colin R

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.