Import VS Color Configuration?


#1

In Visual Studio 2017 (and probably other versions), you can export your configuration of syntax colors to a file.

Is it, or would it be, possible to import that file into Atom to use as a syntax theme?


#2

Good question. I’ve never tried it myself, but VS Code can use TextMate themes as noted here:

And Atom can convert TextMate themes:
https://flight-manual.atom.io/hacking-atom/sections/converting-from-textmate/

So if it’s a TextMate theme, Atom should be able to convert it using the method above. I’ve used it to convert TextMate-formatted themes myself. Never had any issues with it.

I’m not sure how VS Code handles theme exports though, if they’re in TextMate format. Have you done any exports?


#3

Visual Studio Code and Visual Studio 2017 are not related


#4

It’s not a theme, it’s just the custom colors I’ve set for different keywords and whatnot in the editor.


#5

Where would you want to use these colours?

Would a snippet work for you?: type in the name of the colour and the colour code is substituted.


#6

Thanks for clarifying, I misread it as VS Code.

@Magicrafter13, to my understanding, it’s a .vssettings file. Is that correct? Could you maybe post the file to GitHub Gist?


#7

Yes that’s the file, I’ll upload it when I get a chance.


#8

Aight:


#9

Thanks. Could you try this:

  • Press CTRL ,
  • Click “Open Config Folder”
  • Open ‘style.css’

Then paste in the following:

.syntax--enum-block .syntax--cpp {
  color: #0031C1;
}
.syntax--keyword.syntax--control.syntax--cpp {
  color: #52E461;
}

Then press CTRL-S to save and let me know if that’s roughly how you wanted enum and namespace highlighting to look?

I’ll switch to my Windows desktop meanwhile to try and compare between Visual Studio and Atom there. But if the above works for you, that’ll help to know.


#10

Did you mean styles.less? Because in the .atom folder there is no style.css file.


#11

The code works, though it’s very green. for the #include statements, I’m pretty sure I have those set as a gray(/grey) color. Though, I might be able to use your code to set this up how I want, cause I couldn’t figure out the names of the settings (ie .syntax–keyword.syntax–control.syntax–cpp), so thanks for that at least.


#12

You should check out the Editor: Log Cursor Scope command (use ctrl-shift-p to pull up the Command Palette and start typing the command name).


#13

I tried that, but I don’t really want to change scope necessarily. Here’s an example:

int x = 7;

I want every instance of x to be a certain color. What I mean is, I want all variables to have a certain color.

std::string str;

To be more specific, str and x should be the same color, but the scope would be the entire document. There’s probably better ways to word all I’ve said here, but hey; I’m trying. : p


#14

That command tells you the scopes where the cursor is and what to put in your CSS selector.

I want all variables to have a certain color.

Using the command Editor: Log Cursor Scope, can you find a scope name common to all variables? If so, then you can target that with CSS. If not, then the grammar you’re using does not identify variable names and there aren’t any classes you can target.