Sublime Forum

Why codes are not showing colors?

#1

New to sublime text.

I’m wondering why the codes are not showing colors? I’m using Mac.

0 Likes

#2

Syntax highlighting depends on the type of file that you’re editing, so unless you tell it what sort of file you’re editing, Sublime assumes it’s just a text file.

You can do one of the following:

  1. Save the file; once it’s saved, Sublime will know what type of file it is and syntax highlight it.
  2. Open the command palette and enter setsyn to filter to all of the Set Syntax: commands, then pick the one that represents the type of file that you’re working with
  3. Navigate to View > Syntax in the menu and then select from the list the type of file you’re editing.
  4. In the bottom right of the window, the status bar tells you what kind of file Sublime thinks you’re editing (it probably says Plain text). If you click there, you’ll get the same menu as from #3 above; pick the appropriate file type from the list.
2 Likes

#3

Thank you! It works now.

Another question is that how do I see the outputs?

0 Likes

#4

To run a program, use Tools > Build from the menu (or the associated key). That will trigger Sublime to try and build the current file. What that does depends on the type of file you’re editing and what the build system is set to under Tools > Build System.

I would recommend setting it to Automatic, which will make Sublime automatically choose the correct build (if there’s more than one that applies, it will ask you to pick from the valid builds the first time you do this).

More information on the basics of build systems, how they work and how to use them can be found in this video series:

1 Like

#5

thank for your help!

0 Likes