Sublime Forum

[SOLVED] File type alias for syntax highlighting

#1

Currrent Sublime 4 stable is not colouring (syntax highlighting) Meson files (.build file extension) and Vala files (.vala file extension), they are treated as plain text files.

Meson files are a subset of Python so they can be perfectly coloured by choosing “Python” in the languages dropdown. In the same manner Vala language uses a syntax very similar to C#, so Vala files look very good when choosing language “C#” from the dropdown.

My question is: how can I configure Sublime Text so that when opening a meson.build file it automatically uses the “Python” language colouring, and when opening .vala files it uses the C# colouring? in other words, until Sublime Text get support for that languages, how can I alias .build files to be Python and .vala files to be C#.

Thanks!

0 Likes

#2

I searched the forum and bingo! I found solution in this comment which I summarize below:

You can use View > Syntax > Open All with current extension as... and pick the syntax that associates with the file.

Thank you!

0 Likes