|
1 | | -# Sublime Text Monokai C# theme for Visual Studio Code |
2 | | -[](http://unlicense.org/) |
3 | | - |
4 | | -This theme is exactly the same Monokai's theme of Sublime Text but for Visual Studio Code instead. Unlike default VSCode's Monokai, this is an actual, perfect and identical copy of the loved by all Sublime Text's theme. It's name is **Sublime Monokai**. |
| 1 | +# Identical Sublime Text Monokai theme for Visual Studio Code |
5 | 2 |
|
6 | | - - [Visual Studio Marketplace: Theme&Colorizer Extension](https://marketplace.visualstudio.com/items?itemName=maximetinu.identical-sublime-monokai-csharp-theme-colorizer) |
7 | | -## Screenshots |
8 | | - |
9 | | -### Comparison between this theme and Sublime Text's |
10 | | - |
11 | | -### Comparison between default VSCode Monokai theme and Sublime Text's |
12 | | -Observe the differences. Is subtle but it's there. |
13 | | - |
14 | | -## Instructions |
15 | | -Option 1, search for the extension in Visual Studio Code Marketplace: |
16 | | -1. At the Welcome tab *(Help>Welcome)* click "Tools and languages" and search by my "identical sublime monokai theme". Install it. |
17 | | -2. Ready to code! |
| 3 | +[](http://unlicense.org/) |
18 | 4 |
|
19 | | -Option 2, install it as a local VSCode extension: |
20 | | -1. Copy the folders in this repository *csharp-sublime-colorizer* and *theme-sublime-monokai* into your folder *<User Home>/.vscode/extensions/*. |
21 | | -2. Ready to code! |
22 | | - |
23 | | -Make sure that you choose the **Sublime Monokai** color theme at the Welcome tab *(Help>Welcome)* and check bottom right if **C# Sublime Colorizer** is working instead of the default C#, as can be seen in the next screenshot: |
24 | | - |
| 5 | +For C#, this theme is exactly the same Monokai's theme of Sublime Text but for Visual Studio Code instead. Unlike default C# VSCode's Monokai, this is an actual, perfect and identical copy of the loved by all Sublime Text's theme. It's name is **Sublime Monokai**. |
25 | 6 |
|
26 | | -**Why override C# parser/colorizer if it's a theme? Keep reading.** |
| 7 | +While I put special focus on making it identical specifically for C#, it is also close to identical in the case of C, C++ and Python. For other languages like Javascript, Ruby, Java, etc, it's not guaranteed to be 100% identical (or maybe yes, I didn't tested it), but it'll work anyway as just another Monokai theme :) |
27 | 8 |
|
28 | | ---- |
| 9 | +## Language's identicality support |
29 | 10 |
|
30 | | -## Why default VSCode's Monokai is so different from Sublime Text's? |
31 | | -There are two reasons. |
| 11 | +*(yes, that's a made-up word)* |
| 12 | + |
| 13 | +- **First class support *(100% identicality guaranteed)*:** C#. |
| 14 | +- **Second class support *(identical or close to identical, but not heavily tested)*:** C, C++, Python |
| 15 | +- **Third class support *(it will work and should be similar, but wasn't developed or tested. Even if it's identical it wasn't on purpose)*:** Javascript, Ruby, Java, all others. |
32 | 16 |
|
33 | | -First of all, VSCode's theme assign the same style to certains colorizer rules which differ each other in Sublime Text. It's possible to solve it by modifying the default VSCode Monokai's theme. |
| 17 | +## Screenshots (for C#) |
34 | 18 |
|
35 | | -Secondly, no matter how much we modify default VSCode's Monokai, it's impossible to get the same color scheme as Sublime Text due to limitations of the C# colorizer that uses VSCode. On the one hand, VSCode groups in the same selector two things which are different styled in Sublime Text, and it is not possible to assign different styles to things with the same selector. On the other hand, the VSCode C# colorizer is more limited due to it is only possible to assign one single selector to each code token, unlike Sublime Text's colorizer, which allows the assignment of multiple selectors to increase flexibility when it comes to styling. This is because VSCode uses a *.tmLanguage* file as colorizer while Sublime Text uses *.sublime-syntax* files to make the parsing. It is possible to convert from *.tmLanguage* to *.sublime-syntax*, but not the opposite, since *.sublime-syntax* is a superset of *.tmLanguage* functionality, so it is not possible to convert in such a way. |
| 19 | + |
36 | 20 |
|
37 | | -In the next screenshot can be seen the gap between the two colorizers: |
38 | | - |
39 | | -### So, what's the trick, then? |
40 | | -I've modified the VSCode C# colorizer (the *.tmLanguage* file) to differentiate differents elements. Once that's done, I've modified the default VSCode's Monokai theme to assign the styles as Sublime Text does. That's why it's necessary to modify the official C# parser folder. |
| 21 | +### Comparison between this theme and Sublime Text's |
41 | 22 |
|
42 | | -**Happy coding!** now with Monokai ;) |
| 23 | + |
43 | 24 |
|
44 | | ---- |
| 25 | +### Comparison between default VSCode Monokai theme and Sublime Text's |
45 | 26 |
|
46 | | -**UNLICENSED** |
| 27 | +Observe the difference. Is subtle but it's there. |
47 | 28 |
|
48 | | -[](http://unlicense.org/) |
| 29 | + |
49 | 30 |
|
50 | | - - Only tested in Windows 10, but it should also work in MacOS and Linux. |
51 | | - - Only tested with C#, but it should also work for other programming languages. It should be more like Sublime's Monokai working with any language, but it won't be as accurate as with C# since the only colorizer modified is the C# parser. |
52 | | - - Only tested with Visual Studio Code, but it should also work with Visual Studio IDE as long as the *.tmLanguage* file (the colorizer) is modified or replaced and the theme is installed too. |
53 | | - |
54 | | -In general, it should also work in any editor which uses the same Text Mate grammar tokens as theme and the *.tmLanguage* as colorizer, as Text Mate editor itself. |
| 31 | +**Happy coding!** now with Monokai ;) |
0 commit comments