Sublime Forum

File extension as C

#1

How do I force sublime text to open every new file I create as C. When I click on “open all with current extensions as…” It gives me some languages to select from but for some reason “C” is greyed out and it won’t let me pick it.

Can I fix this or do I have to manually change every new file from “plain text” to “C” ??

0 Likes

#2

Sublime Text will automatically change the syntax when saving a new file, although this is currently broken in the latest development build and will be fixed in the next one. If a syntax is greyed out in that menu that likely means it’s already selected.

0 Likes

#3

So it’ll only switch from “plain text” to “c” after saving the file ? Can’t I somehow just click on “New File” and open it as a “C” file ?

To my understanding the “C” syntax isn’t greyed out because it’s already in use, but because “Open all with current extension as” isn’t available for it, selectable languages are highlighted in white.

All my new files are opened as “plain text” by default, and I have to manually change it to “C” everytime, i’ve marked in blue what I’m referring too, hopefully the picture is clear

0 Likes

#4

If you haven’t saved the file then it doesn’t have a file extension and so everything in that menu will be grayed out. You need to save the file first. Note that if you give the file the standard .c extension ST will by default automatically change the syntax to C.

0 Likes

#5

Okay, but so there is no way to automate the process right ? Everytime time I open a new file I’ll have to name it with the .C extension.

Also this is unrelated but for some reason the dark mode won’t work on my windows 11 device


The screen will stay light

0 Likes

#6

Okay, but so there is no way to automate the process right ? Everytime time I open a new file I’ll have to name it with the .C extension.

Yes. You need to name the file anyway, so it’s just 2 extra characters. If you’re working with C you’ll be working with other file extensions like .h, Makefile and more.

Also this is unrelated but for some reason the dark mode won’t work on my windows 11 device

The theme and color scheme are separate concepts in Sublime Text. You’ll need to select either the dark or adaptive theme and a dark color scheme. The color scheme affects the text editing area and the theme affects the rest of the application.

0 Likes

#7

I’ve clicked onto all of the options, but it stayed light all the time. Am I somehow missing the dark schemes ? Is “Color scheme - Default” supposed to be under every theme name ? Or should I also have “Color scheme - Dark” ??

0 Likes

#8

Mariana and Monokai are dark color schemes. The thing underneath the color scheme tells you which package it comes from.

0 Likes